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

:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --border: #e3e7f0;
  --border-strong: #d2d8e6;
  --text: #171a26;
  --text-muted: #5b6478;
  --text-soft: #8b93a7;
  --accent: #6d5efc;
  --accent-2: #9b6bff;
  --accent-soft: rgba(109, 94, 252, 0.1);
  --accent-grad: linear-gradient(135deg, #6d5efc 0%, #9b6bff 55%, #c46bff 100%);
  --success: #16a34a;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 38, 0.06);
  --shadow: 0 8px 30px rgba(23, 26, 38, 0.08);
  --shadow-lg: 0 20px 50px rgba(23, 26, 38, 0.12);
  --shadow-accent: 0 10px 30px rgba(109, 94, 252, 0.28);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100%;
}

main {
  max-width: 100%;
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  will-change: transform;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent-grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(109, 94, 252, 0.4);
  background-position: 100% 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  --header-h: 68px;
  background: rgba(247, 248, 252, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(247, 248, 252, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.footer-legal-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.footer-lang {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.footer-lang a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.15rem 0.25rem;
}

.footer-lang a:hover {
  color: var(--text);
}

.footer-lang a.footer-lang-active {
  color: var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
  transition: transform 0.4s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-12deg) scale(1.08);
}

.brand-accent {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a:not(.btn):not(.nav-dropdown-trigger):not(.nav-dropdown-item) {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
}

.site-nav a:not(.btn):not(.nav-dropdown-trigger):not(.nav-dropdown-item)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.site-nav a:not(.btn):not(.nav-dropdown-trigger):not(.nav-dropdown-item):hover {
  color: var(--text);
}

.site-nav a:not(.btn):not(.nav-dropdown-trigger):not(.nav-dropdown-item):hover::after {
  transform: scaleX(1);
}

.nav-dropdown {
  position: relative;
}

/* Invisible bridge so the menu stays open while moving the cursor down */
.nav-dropdown::after {
  content: "";
  position: absolute;
  left: -0.5rem;
  right: -0.5rem;
  top: 100%;
  height: 0.85rem;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
  padding-bottom: 2px;
}

button.nav-dropdown-trigger {
  background: none;
  border: none;
  padding: 0;
  padding-bottom: 2px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.nav-dropdown-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: var(--text);
}

.nav-dropdown:hover .nav-dropdown-trigger::after,
.nav-dropdown:focus-within .nav-dropdown-trigger::after {
  transform: scaleX(1);
}

.nav-dropdown-chevron {
  opacity: 0.65;
  transition: transform 0.2s var(--ease);
}

.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown:focus-within .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 260px;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s var(--ease);
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Mega menu — tools grouped by category, centered on screen */
.nav-dropdown--mega::after {
  display: none;
}

.nav-mega-menu {
  position: fixed;
  top: calc(var(--header-h) + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.985);
  width: min(640px, calc(100vw - 2.5rem));
  padding: 0;
  background: var(--surface);
  border: 1px solid rgba(109, 94, 252, 0.12);
  border-radius: var(--radius);
  box-shadow:
    0 4px 6px rgba(23, 26, 38, 0.03),
    0 24px 64px rgba(23, 26, 38, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s var(--ease),
    transform 0.28s var(--ease),
    visibility 0.24s var(--ease);
  z-index: 100;
  overflow: hidden;
}

.nav-mega-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown--mega.is-open .nav-mega-menu,
.nav-dropdown--mega:focus-within .nav-mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-dropdown--mega.is-open .nav-dropdown-trigger,
.nav-dropdown--mega:focus-within .nav-dropdown-trigger {
  color: var(--text);
}

.nav-dropdown--mega.is-open .nav-dropdown-trigger::after,
.nav-dropdown--mega:focus-within .nav-dropdown-trigger::after {
  transform: scaleX(1);
}

.nav-dropdown--mega.is-open .nav-dropdown-chevron,
.nav-dropdown--mega:focus-within .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-mega-intro {
  padding: 1.35rem 1.75rem 1.1rem;
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.07) 0%, rgba(155, 107, 255, 0.04) 100%);
  border-bottom: 1px solid var(--border);
}

.nav-mega-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-mega-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nav-mega-viewport {
  overflow: hidden;
}

.nav-mega-track {
  display: flex;
  width: 200%;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-mega-track--instant {
  transition: none;
}

.nav-mega-track[data-mega-view="sub"] {
  transform: translateX(-50%);
}

.nav-mega-panel {
  flex: 0 0 50%;
  width: 50%;
  min-width: 0;
}

.nav-mega-panel--root {
  display: flex;
  flex-direction: column;
}

.nav-mega-panel--sub {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  max-height: min(70vh, 520px);
}

.nav-mega-categories {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
}

.nav-mega-cat-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.nav-mega-cat-row:hover,
.nav-mega-cat-row:focus-visible {
  background: var(--accent-soft);
  border-color: rgba(109, 94, 252, 0.28);
  box-shadow: 0 4px 16px rgba(109, 94, 252, 0.08);
  outline: none;
}

.nav-mega-cat-row[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.1) 0%, rgba(155, 107, 255, 0.06) 100%);
  border-color: rgba(109, 94, 252, 0.35);
}

.nav-mega-cat-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.nav-mega-cat-row:hover .nav-mega-cat-icon,
.nav-mega-cat-row[aria-expanded="true"] .nav-mega-cat-icon {
  background: var(--surface);
  border-color: rgba(109, 94, 252, 0.25);
}

.nav-mega-cat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-mega-cat-label {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-mega-cat-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-mega-cat-blurb {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-mega-cat-chevron {
  flex-shrink: 0;
  color: var(--text-soft);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-mega-cat-row:hover .nav-mega-cat-chevron {
  color: var(--accent);
  transform: translateX(2px);
}

.nav-mega-subpanel:not([hidden]) {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  min-height: 0;
}

.nav-mega-subhead {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.07) 0%, rgba(155, 107, 255, 0.04) 100%);
  border-bottom: 1px solid var(--border);
}

.nav-mega-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-mega-back:hover,
.nav-mega-back:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(109, 94, 252, 0.25);
  outline: none;
}

.nav-mega-subtitle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.nav-mega-sub-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(109, 94, 252, 0.18);
}

.nav-mega-subtitle-text {
  min-width: 0;
}

.nav-mega-subtitle-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-mega-subtitle-count {
  margin: 0.1rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.nav-mega-sublist {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-mega-sublist::-webkit-scrollbar {
  width: 6px;
}

.nav-mega-sublist::-webkit-scrollbar-thumb {
  background: rgba(109, 94, 252, 0.22);
  border-radius: 999px;
}

.nav-mega-subfooter {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem 1rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  text-align: center;
}

.nav-mega-section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.18s var(--ease);
}

.nav-mega-section-link:hover {
  opacity: 0.85;
  color: var(--accent);
}

.nav-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem 0.5rem;
  padding: 1.15rem 1.25rem 1rem;
}

.nav-mega-col {
  min-width: 0;
}

.nav-mega-heading {
  margin: 0 0 0.55rem;
  padding: 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-mega-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-mega-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-mega-item:hover {
  background: var(--accent-soft);
  border-color: rgba(109, 94, 252, 0.12);
  transform: none;
}

.nav-mega-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.125rem;
  line-height: 1;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.nav-mega-item:hover .nav-mega-item-icon {
  background: var(--surface);
  border-color: rgba(109, 94, 252, 0.22);
  box-shadow: 0 4px 12px rgba(109, 94, 252, 0.12);
}

.nav-mega-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.1rem;
}

.nav-mega-item-label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  transition: color 0.18s var(--ease);
}

.nav-mega-item-desc {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-mega-item:hover .nav-mega-item-label {
  color: var(--accent);
}

.nav-mega-footer {
  padding: 0.85rem 1.75rem 1.15rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  text-align: center;
}

.nav-mega-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(109, 94, 252, 0.18);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.nav-mega-all:hover {
  background: var(--accent-soft);
  border-color: rgba(109, 94, 252, 0.35);
  box-shadow: 0 6px 20px rgba(109, 94, 252, 0.14);
  transform: translateY(-1px);
  color: var(--accent);
}

@media (max-width: 960px) {
  .nav-mega-categories {
    padding: 0.75rem 0.85rem 0.9rem;
  }

  .nav-mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    padding: 1rem 1rem 0.85rem;
  }

  .nav-mega-intro {
    padding: 1.15rem 1.25rem 0.95rem;
  }

  .nav-mega-footer {
    padding: 0.75rem 1.25rem 1rem;
  }

  .nav-mega-panel--sub {
    min-height: 320px;
    max-height: min(75vh, 480px);
  }

  .nav-mega-subhead {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 720px) {
  .nav-mega-menu {
    width: min(calc(100vw - 1.5rem), 400px);
  }

  .nav-mega-item-desc {
    -webkit-line-clamp: 1;
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-dropdown-item.is-current {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
  font-weight: 600;
}

.nav-dropdown--lang .nav-dropdown-menu {
  min-width: 200px;
  left: auto;
  right: 0;
  transform: translateY(4px);
}

.nav-dropdown--lang:hover .nav-dropdown-menu,
.nav-dropdown--lang:focus-within .nav-dropdown-menu {
  transform: translateY(0);
}

.nav-dropdown-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.nav-dropdown-label {
  line-height: 1.3;
}

@media (max-width: 720px) {
  /* Only hide top-level nav links — not tool links inside the mega menu or lang dropdown */
  .site-nav > a:not(.btn) {
    display: none;
  }

  .site-nav .nav-dropdown--lang,
  .site-nav .nav-mega-item,
  .site-nav .nav-mega-all,
  .site-nav .nav-mega-section-link {
    display: flex;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 2.25rem 0 3rem;
  overflow-x: hidden; /* fallback for browsers without clip */
  overflow-x: clip;
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(closest-side, rgba(155, 107, 255, 0.22), rgba(109, 94, 252, 0.08) 60%, transparent);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}

.hero-copy {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 1.75rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  font-weight: 900;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #171a26 0%, #4b3fd6 60%, #9b6bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.lede strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Tool ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.toolbar.hidden {
  display: none;
}

.color-picker-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .color-picker-layout {
    grid-template-columns: 1fr;
  }
}

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--surface-2);
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.drop-zone .drop-icon {
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.drop-zone:hover .drop-icon,
.drop-zone.dragover .drop-icon {
  transform: translateY(-4px) scale(1.05);
}

.drop-zone h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.drop-zone p {
  color: var(--text-muted);
}

.link-look {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.drop-zone .hint {
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
}

.canvas-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: repeating-conic-gradient(#e9edf5 0% 25%, #f7f9fd 0% 50%) 50% / 18px 18px;
  cursor: crosshair;
  display: none;
  border: 1px solid var(--border);
}

.canvas-wrapper.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Image / meme tool layout (icr-*) ---------- */
.hidden {
  display: none !important;
}

.icr-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .icr-layout {
    grid-template-columns: 1fr;
  }
}

.img-workspace {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: repeating-conic-gradient(#e9edf5 0% 25%, #f7f9fd 0% 50%) 50% / 18px 18px;
  cursor: crosshair;
  display: none;
  border: 1px solid var(--border);
}

.img-workspace.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.img-workspace canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.ic-settings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ic-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.ic-field > label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.ic-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ic-field-val {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ic-input,
.ic-select {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
}

.ic-color {
  width: 100%;
  height: 2.75rem;
  padding: 0.2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.ic-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 640px) {
  .ic-settings {
    gap: 1.1rem;
  }

  .ic-field-head {
    flex-wrap: wrap;
  }

  .ic-input,
  .ic-select {
    font-size: 1rem;
  }
}

/* ---------- Magnifier ---------- */
.magnifier {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  display: none;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-lg);
  overflow: hidden;
  width: 120px;
  height: 120px;
}

.magnifier.active {
  display: block;
}

.magnifier canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.magnifier-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.current-color-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

.current-color {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-swatch {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  background:
    linear-gradient(#dfe4ee, #dfe4ee) padding-box;
  box-shadow: inset 0 0 0 3px #fff;
  transition: transform 0.25s var(--ease);
}

.current-color-info h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.hex-value {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.hex-value:hover {
  color: var(--accent);
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.color-value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-value-row label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  width: 2.5rem;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.color-value-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.color-value-row input:hover {
  border-color: var(--border-strong);
}

.color-value-row input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.copy-btn {
  flex-shrink: 0;
  padding: 0.45rem;
  border-radius: 8px;
  color: var(--text-soft);
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.palette-swatch {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  padding: 0;
}

.palette-swatch:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.palette-swatch.selected {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.palette-empty {
  font-size: 0.8125rem;
  color: var(--text-soft);
  font-style: italic;
}

input[type="file"] {
  display: none;
}

/* ---------- Unit Converter tool ---------- */
.uc-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.uc-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.uc-cat:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.uc-cat.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.uc-cat-icon {
  font-size: 1rem;
  line-height: 1;
}

.uc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .uc-layout {
    grid-template-columns: 1fr;
  }
}

.uc-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.uc-converter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 620px) {
  .uc-converter {
    grid-template-columns: 1fr;
  }
}

.uc-field {
  min-width: 0;
}

.uc-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.uc-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.uc-value-wrap {
  position: relative;
}

.uc-value {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 2.9rem 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.uc-copy {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.uc-value-wrap:hover .uc-copy,
.uc-copy:focus-visible {
  opacity: 1;
}

.uc-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.uc-copy:active {
  transform: translateY(-50%) scale(0.92);
}

.uc-value:hover {
  border-color: var(--accent);
}

.uc-value:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.uc-unit {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.uc-unit:hover {
  border-color: var(--accent);
}

.uc-unit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.uc-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.uc-swap:hover {
  transform: rotate(180deg);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.uc-swap:active {
  background: var(--accent-soft);
}

@media (max-width: 620px) {
  .uc-swap {
    transform: rotate(90deg);
    margin: 0 auto;
  }
  .uc-swap:hover {
    transform: rotate(270deg);
  }
}

.uc-summary {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.0625rem;
  text-align: center;
}

.uc-summary strong {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
}

.uc-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.uc-saved {
  margin-top: 1rem;
}

.uc-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.uc-saved-head .section-title {
  margin-bottom: 0;
}

.uc-saved-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.uc-saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.uc-saved-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.uc-saved-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.uc-saved-cat {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.uc-saved-text {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-saved-text strong {
  color: var(--text);
  font-weight: 600;
}

.uc-saved-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.uc-remove {
  flex-shrink: 0;
  padding: 0.45rem;
  border-radius: 8px;
  color: var(--text-soft);
}

.uc-remove:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.uc-common {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.uc-common-head {
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.uc-common-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 2.3rem 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.uc-common-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(3px);
}

.uc-common-copy {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}

.uc-common-row:hover .uc-common-copy {
  opacity: 1;
  color: var(--accent);
}

.uc-common-val {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-common-unit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* ---------- Percentage Calculator tool ---------- */
.pc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pc-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.pc-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pc-tab.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.pc-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.pc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .pc-layout {
    grid-template-columns: 1fr;
  }
}

.pc-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.pc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.1rem;
}

.pc-field {
  min-width: 0;
}

.pc-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.pc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pc-input {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.pc-input.has-prefix {
  padding-left: 2.1rem;
}

.pc-input.has-suffix {
  padding-right: 3.4rem;
}

.pc-input:hover {
  border-color: var(--accent);
}

.pc-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.pc-affix {
  position: absolute;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
}

.pc-prefix {
  left: 0.9rem;
}

.pc-suffix {
  right: 0.9rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pc-result {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.pc-result-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  margin: 0;
}

.pc-result-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pc-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.pc-result-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pc-result-value {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  word-break: break-word;
}

.pc-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.pc-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.pc-copy:active {
  transform: scale(0.92);
}

.pc-result-sentence {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.pc-breakdown {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pc-breakdown li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.pc-breakdown-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.pc-breakdown-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
}

.pc-formula {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pc-formula-empty {
  color: var(--text-soft);
  font-size: 0.9375rem;
  margin: 0;
}

.pc-formula-line {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ---------- Loan & Mortgage Calculator tool ---------- */
.ln-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ln-layout {
    grid-template-columns: 1fr;
  }
}

.ln-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.ln-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.ln-field-wide {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  .ln-fields {
    grid-template-columns: 1fr;
  }
  .ln-field-wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .ln-panel {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .ln-fields {
    grid-template-columns: 1fr;
  }

  .ln-result-value {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .ln-input {
    font-size: 1rem;
    padding: 0.75rem 0.85rem;
  }

  .ln-input.has-suffix {
    padding-right: 3rem;
  }
}

.ln-field {
  min-width: 0;
}

.ln-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.ln-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ln-input {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.ln-input.has-prefix {
  padding-left: 2.4rem;
}

.ln-input.has-suffix {
  padding-right: 3.6rem;
}

.ln-input:hover {
  border-color: var(--accent);
}

.ln-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ln-affix {
  position: absolute;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  pointer-events: none;
}

.ln-prefix {
  left: 0.9rem;
}

.ln-suffix {
  right: 0.9rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ln-select {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 2.4rem 0.85rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.ln-select:hover {
  border-color: var(--accent);
}

.ln-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ln-result {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ln-result-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  margin: 0;
}

.ln-result-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ln-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.ln-result-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ln-result-value {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  word-break: break-word;
}

.ln-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.ln-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ln-copy:active {
  transform: scale(0.92);
}

.ln-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1.5rem;
}

@media (max-width: 520px) {
  .ln-breakdown {
    grid-template-columns: 1fr;
  }
}

.ln-breakdown li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.ln-breakdown-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.ln-breakdown-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.ln-schedule {
  margin-top: 1rem;
}

.ln-table-wrap {
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ln-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ln-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  text-align: right;
  padding: 0.7rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}

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

.ln-table td {
  padding: 0.6rem 0.9rem;
  text-align: right;
  font-family: var(--mono);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.ln-table tbody tr:last-child td {
  border-bottom: none;
}

.ln-table tbody tr:hover td {
  background: var(--accent-soft);
}

.ln-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ln-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.ln-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.ln-tips strong {
  color: var(--text);
  font-weight: 600;
}

.prose-note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

/* ---------- Random Picker tool ---------- */
.rp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.rp-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rp-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.rp-tab.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.rp-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.rp-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .rp-layout {
    grid-template-columns: 1fr;
  }
}

.rp-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rp-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.rp-fields-inline {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 620px) {
  .rp-fields,
  .rp-fields-inline {
    grid-template-columns: 1fr;
  }
}

.rp-field {
  min-width: 0;
}

.rp-field-wide {
  grid-column: 1 / -1;
}

.rp-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.rp-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-soft);
}

.rp-input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.rp-input:hover {
  border-color: var(--accent);
}

.rp-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.rp-textarea {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rp-textarea:hover {
  border-color: var(--accent);
}

.rp-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.rp-count {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.rp-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.rp-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.rp-display-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.rp-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  width: 100%;
  max-width: 480px;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 2px solid var(--border);
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  color: var(--text);
  text-align: center;
  word-break: break-word;
  transition: transform 0.15s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), color 0.2s var(--ease);
}

.rp-display.is-spinning {
  color: var(--text-muted);
  border-color: var(--accent);
  transform: scale(0.98);
}

.rp-display.is-reveal {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  color: var(--accent);
  transform: scale(1.03);
}

.rp-actions {
  display: flex;
  justify-content: center;
}

.rp-actions .btn {
  min-width: 200px;
  gap: 0.5rem;
}

.rp-actions .btn.is-spinning {
  opacity: 0.7;
  pointer-events: none;
}

.rp-results,
.rp-teams,
.rp-picked {
  padding-top: 0.5rem;
}

.rp-picked-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rp-chips-picked {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-behavior: smooth;
}

.rp-chips-picked .rp-chip {
  flex-shrink: 0;
}

.rp-chip-new {
  animation: rp-chip-in 0.35s var(--ease);
}

@keyframes rp-chip-in {
  from {
    opacity: 0;
    transform: scale(0.85) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

.rp-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rp-results-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.rp-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rp-chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
}

.rp-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.rp-team-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rp-team-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.rp-team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rp-team-list li {
  font-size: 0.9375rem;
  color: var(--text);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.rp-team-list li:last-child {
  border-bottom: none;
}

.rp-history {
  margin-top: 1rem;
}

.rp-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rp-history-head .section-title {
  margin-bottom: 0;
}

.rp-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rp-history-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.rp-history-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  flex-shrink: 0;
}

.rp-history-value {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rp-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.rp-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.rp-tips strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- BMI Calculator tool ---------- */
.bmi-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .bmi-layout {
    grid-template-columns: 1fr;
  }
}

.bmi-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bmi-unit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bmi-unit-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.bmi-unit-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bmi-unit-tab.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.bmi-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

@media (max-width: 520px) {
  .bmi-fields {
    grid-template-columns: 1fr;
  }
}

.bmi-field {
  min-width: 0;
}

.bmi-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.bmi-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bmi-height-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.bmi-height-split .bmi-input-wrap {
  min-width: 0;
}

.bmi-input {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.bmi-input.has-suffix {
  padding-right: 3rem;
}

.bmi-input:hover {
  border-color: var(--accent);
}

.bmi-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.bmi-affix {
  position: absolute;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.bmi-suffix {
  right: 0.9rem;
}

.bmi-result {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.bmi-result-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  margin: 0;
}

.bmi-result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.bmi-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.bmi-result-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bmi-result-value {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.bmi-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.bmi-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.bmi-category {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
}

.bmi-cat-under { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.bmi-cat-normal { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.bmi-cat-over { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.bmi-cat-ob1 { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.bmi-cat-ob2 { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.bmi-cat-ob3 { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }

.bmi-scale {
  position: relative;
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

.bmi-scale-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  opacity: 0.85;
}

.bmi-scale-seg {
  display: block;
  height: 100%;
}

.bmi-scale-marker {
  position: absolute;
  top: 0;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: left 0.35s var(--ease), background 0.35s var(--ease);
}

.bmi-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bmi-details li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.bmi-detail-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.bmi-detail-value {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.bmi-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bmi-legend li {
  display: grid;
  grid-template-columns: 10px 4.5rem 1fr;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
}

.bmi-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bmi-legend-range {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.bmi-legend-label {
  color: var(--text-muted);
}

/* ---------- Word & Character Counter tool ---------- */
.wc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .wc-layout {
    grid-template-columns: 1fr;
  }
}

.wc-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wc-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.wc-editor-head label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.wc-char-count {
  font-size: 0.8125rem;
  color: var(--text-soft);
  font-family: var(--mono);
}

.wc-textarea {
  width: 100%;
  min-width: 0;
  min-height: 280px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.wc-textarea:hover {
  border-color: var(--accent);
}

.wc-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.wc-textarea::placeholder {
  color: var(--text-soft);
}

.wc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.wc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .wc-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wc-stat {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.wc-stat-primary {
  grid-column: span 2;
  background: var(--accent-soft);
  border-color: transparent;
}

@media (max-width: 720px) {
  .wc-stat-primary {
    grid-column: span 2;
  }
}

.wc-stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.wc-stat-primary .wc-stat-value {
  font-size: 2rem;
  color: var(--accent);
}

.wc-stat-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc-seo {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.wc-seo-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wc-seo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.wc-seo-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wc-seo-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.wc-seo-empty { background: var(--surface-2); color: var(--text-soft); }
.wc-seo-short { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.wc-seo-good { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.wc-seo-long { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.wc-seo-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.wc-seo-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s var(--ease), background 0.25s var(--ease);
  min-width: 2px;
}

.wc-seo-fill.wc-seo-empty { background: var(--border-strong); }
.wc-seo-fill.wc-seo-short { background: #f59e0b; }
.wc-seo-fill.wc-seo-good { background: #22c55e; }
.wc-seo-fill.wc-seo-long { background: #ef4444; }

.wc-seo-meta {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--text-soft);
}

.wc-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wc-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.wc-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.wc-tips strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Time Zone Converter tool ---------- */
.tz-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .tz-layout {
    grid-template-columns: 1fr;
  }
}

.tz-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tz-converter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .tz-converter {
    grid-template-columns: 1fr;
  }
  .tz-mid {
    order: 3;
    justify-self: center;
  }
}

.tz-field {
  min-width: 0;
}

.tz-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.tz-select {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 2.4rem 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tz-select:hover {
  border-color: var(--accent);
}

.tz-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tz-datetime {
  display: grid;
  grid-template-columns: minmax(11rem, 1.4fr) minmax(7rem, 0.8fr);
  gap: 0.75rem;
  max-width: 28rem;
}

@media (max-width: 520px) {
  .tz-datetime {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .tz-panel {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .tz-result-value {
    font-size: 1rem;
  }
}

.tz-datetime-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.tz-input-date {
  min-width: 0;
}

.tz-input-time {
  min-width: 0;
}

.tz-input[type="date"] {
  padding-right: 0.35rem;
}

.tz-input[type="date"]::-webkit-calendar-picker-indicator {
  margin-left: 0.15rem;
  cursor: pointer;
}

.tz-input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tz-input:hover {
  border-color: var(--accent);
}

.tz-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tz-mid {
  display: flex;
  align-items: center;
  padding-top: 1.6rem;
}

.tz-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.tz-swap:hover {
  transform: rotate(180deg);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.tz-swap:active {
  background: var(--accent-soft);
}

@media (max-width: 720px) {
  .tz-swap {
    transform: rotate(90deg);
  }
  .tz-swap:hover {
    transform: rotate(270deg);
  }
  .tz-mid {
    padding-top: 0;
  }
}

.tz-actions {
  display: flex;
  justify-content: flex-start;
}

.tz-result {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tz-result-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  margin: 0;
}

.tz-result-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tz-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.tz-result-main {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.tz-result-value {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.tz-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.tz-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.tz-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1.5rem;
}

@media (max-width: 520px) {
  .tz-details {
    grid-template-columns: 1fr;
  }
}

.tz-details li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.tz-detail-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.tz-detail-value {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-size: 0.875rem;
}

.tz-clocks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tz-clock {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
}

.tz-clock-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.tz-clock-time {
  display: block;
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.tz-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tz-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tz-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.tz-tips strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Age & Date Difference Calculator tool ---------- */
.ac-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ac-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.ac-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.ac-tab.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.ac-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.ac-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ac-layout {
    grid-template-columns: 1fr;
  }
}

.ac-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.ac-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

@media (max-width: 560px) {
  .ac-fields {
    grid-template-columns: 1fr;
  }
}

.ac-field {
  min-width: 0;
}

.ac-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.ac-field-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ac-field-row .ac-input {
  flex: 1;
  min-width: 0;
}

.ac-input {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.ac-input:hover {
  border-color: var(--accent);
}

.ac-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ac-result {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ac-result-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  margin: 0;
}

.ac-result-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ac-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.ac-result-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ac-result-value {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  word-break: break-word;
}

.ac-result-sentence {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.ac-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.ac-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ac-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ac-details li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.ac-details li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ac-detail-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.ac-detail-value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: right;
}

.ac-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ac-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.ac-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.ac-tips strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Currency Converter tool ---------- */
.cc-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.cc-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cc-status-loading {
  background: var(--text-soft);
  animation: cc-pulse 1.2s ease-in-out infinite;
}

.cc-status-live {
  background: #22c55e;
}

.cc-status-cached {
  background: #f59e0b;
}

.cc-status-error {
  background: #ef4444;
}

@keyframes cc-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.cc-link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-link-btn:hover {
  color: var(--accent-hover, var(--accent));
}

.cc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .cc-layout {
    grid-template-columns: 1fr;
  }
}

.cc-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.cc-converter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 620px) {
  .cc-converter {
    grid-template-columns: 1fr;
  }
}

.cc-field {
  min-width: 0;
}

.cc-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.cc-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-value-wrap {
  position: relative;
}

.cc-value {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 2.9rem 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.cc-copy {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.cc-value-wrap:hover .cc-copy,
.cc-copy:focus-visible {
  opacity: 1;
}

.cc-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.cc-copy:active {
  transform: translateY(-50%) scale(0.92);
}

.cc-value:hover {
  border-color: var(--accent);
}

.cc-value:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.cc-currency {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cc-currency:hover {
  border-color: var(--accent);
}

.cc-currency:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.cc-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.cc-swap:hover {
  transform: rotate(180deg);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.cc-swap:active {
  background: var(--accent-soft);
}

@media (max-width: 620px) {
  .cc-swap {
    transform: rotate(90deg);
    margin: 0 auto;
  }
  .cc-swap:hover {
    transform: rotate(270deg);
  }
}

.cc-summary {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.0625rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cc-summary strong {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
}

.cc-summary-rate {
  font-size: 0.875rem;
  font-family: var(--mono);
  color: var(--text-soft);
}

.cc-summary-error {
  color: var(--text-muted);
}

.cc-attribution {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

.cc-attribution a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.cc-attribution a:hover {
  text-decoration: underline;
}

.cc-quick {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cc-quick-head {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
}

.cc-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease);
}

.cc-quick-row:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cc-quick-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.cc-quick-val {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: right;
}

.cc-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.cc-saved {
  margin-top: 1rem;
}

.cc-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.cc-saved-head .section-title {
  margin-bottom: 0;
}

.cc-saved-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.cc-saved-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.cc-saved-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.cc-saved-pair {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.cc-saved-text {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-saved-text strong {
  color: var(--text);
  font-weight: 600;
}

.cc-saved-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.cc-remove {
  flex-shrink: 0;
  padding: 0.45rem;
  border-radius: 8px;
}

/* ---------- Password Strength Checker tool ---------- */
.pw-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .pw-layout {
    grid-template-columns: 1fr;
  }
}

.pw-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pw-input-block > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.pw-input-block,
.pg-output-block {
  width: 100%;
  min-width: 0;
}

.pw-input-row,
.pg-output-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.pw-field-shell {
  position: relative;
  flex: 1;
  min-width: 0;
}

.pw-input.has-field-actions,
.pg-output.has-field-actions {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.9rem;
}

.pw-field-copy {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.pw-field-shell:hover .pw-field-copy,
.pw-field-copy:focus-visible {
  opacity: 1;
}

.pw-field-copy:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.pw-field-copy:active {
  transform: translateY(-50%) scale(0.92);
}

.pw-input-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.pw-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.pw-input:hover {
  border-color: var(--accent);
}

.pw-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.pw-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), opacity 0.2s var(--ease);
}

.pw-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pw-toggle.is-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  opacity: 0.85;
}

.pw-privacy-note {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.pw-privacy-note strong {
  color: var(--text-muted);
  font-weight: 600;
}

.pw-meter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pw-meter-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.pw-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--border-strong);
  transition: width 0.35s var(--ease), background 0.35s var(--ease);
}

.pw-meter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--mono);
}

.pw-meter.pw-very-weak .pw-meter-fill { background: #ef4444; }
.pw-meter.pw-weak .pw-meter-fill { background: #f97316; }
.pw-meter.pw-fair .pw-meter-fill { background: #f59e0b; }
.pw-meter.pw-strong .pw-meter-fill { background: #84cc16; }
.pw-meter.pw-very-strong .pw-meter-fill { background: #22c55e; }

.pw-meter.pw-very-weak .pw-meter-label { color: #dc2626; }
.pw-meter.pw-weak .pw-meter-label { color: #ea580c; }
.pw-meter.pw-fair .pw-meter-label { color: #d97706; }
.pw-meter.pw-strong .pw-meter-label { color: #65a30d; }
.pw-meter.pw-very-strong .pw-meter-label { color: #16a34a; }

.pw-result {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.pw-summary-empty {
  margin: 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.pw-result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.pw-result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.pw-result-value {
  font-family: var(--mono);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
}

.pw-result-value.pw-very-weak { color: #dc2626; }
.pw-result-value.pw-weak { color: #ea580c; }
.pw-result-value.pw-fair { color: #d97706; }
.pw-result-value.pw-strong { color: #65a30d; }
.pw-result-value.pw-very-strong { color: #16a34a; }

.pw-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}

@media (max-width: 560px) {
  .pw-checks {
    grid-template-columns: 1fr;
  }
}

.pw-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.pw-check-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

.pw-check-pass {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.pw-check-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.pw-check.is-pass .pw-check-label {
  color: var(--text);
}

.pw-check.is-fail .pw-check-label {
  color: var(--text-muted);
}

.pw-check-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.1rem;
}

.pw-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pw-details li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.pw-details li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pw-detail-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.pw-detail-value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: right;
}

.pw-footnote {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.pw-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pw-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pw-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.pw-tips strong {
  color: var(--text);
  font-weight: 600;
}

.pw-tips a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.pw-tips a:hover {
  text-decoration: underline;
}

/* ---------- Password Generator tool ---------- */
.pg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pg-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.pg-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pg-tab.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.pg-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.pg-tool-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 780px) {
  .pg-layout {
    grid-template-columns: 1fr;
  }
}

.pg-below {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 780px) {
  .pg-below {
    grid-template-columns: 1fr;
  }
}

.pg-tips-card {
  margin: 0;
}

.pg-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pg-option-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.pg-option-head label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.pg-option-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.pg-range {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}

.pg-checks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 1rem;
}

@media (max-width: 560px) {
  .pg-checks-grid {
    grid-template-columns: 1fr;
  }
}

.pg-check-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
}

.pg-check-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.pg-check-full {
  grid-column: 1 / -1;
}

.pg-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.pg-field > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.pg-select {
  width: 100%;
  padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.pg-output-block > label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.pg-strength-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 2rem 1.75rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.pg-str-checks {
  grid-template-columns: 1fr;
}

.pg-strength-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pg-strength-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.pg-strength-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.pg-output {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.pg-output:hover {
  border-color: var(--accent);
}

.pg-output:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.pg-summary {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
}

.pg-summary strong {
  color: var(--text);
  font-family: var(--mono);
}

.pg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pg-privacy-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.pg-privacy-note strong {
  color: var(--text-muted);
  font-weight: 600;
}

.pg-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pg-tips li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pg-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.pg-tips strong {
  color: var(--text);
  font-weight: 600;
}

.pg-tips a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.pg-tips a:hover {
  text-decoration: underline;
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.375rem);
  font-weight: 800;
  margin: 0.9rem 0 0.75rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* Steps */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

@media (max-width: 780px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1.1rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.step-card:hover .step-num {
  background: var(--accent-grad);
  color: #fff;
  transform: scale(1.05);
}

.step-card h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: 0;
}

.feature-card > * {
  position: relative;
  z-index: 1;
  transition: color 0.3s var(--ease);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover h3,
.feature-card:hover p {
  color: #fff;
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.85rem;
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(-6deg);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Prose */
.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: clamp(1.6rem, 3vw, 2.125rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  text-align: center;
}

.prose p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 1.15rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* FAQ */
.faq {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 1.35rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.faq-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.faq-item[open] {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.0625rem;
  padding: 1.15rem 2rem 1.15rem 0;
  position: relative;
  transition: color 0.2s var(--ease);
}

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

.faq-item summary:hover {
  color: var(--accent);
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-item p {
  color: var(--text-muted);
  padding: 0 0 1.25rem;
  margin: 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-soft);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--text-soft);
  opacity: 0.6;
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Home hero ---------- */
.home-hero {
  padding: 4rem 0 3rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

/* ---------- Tools grid (home) ---------- */
.tools-by-category {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
}

.tools-category:last-child {
  margin-bottom: 0;
}

.tools-category-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

/* Homepage — compact tool cards, roomier section headers */
.tools-by-category .tools-category-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
  margin: 0 0 1.125rem;
  padding: 0 0 0 0.85rem;
  border: none;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}

.tools-by-category .tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

@media (min-width: 900px) {
  .tools-by-category .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .tools-by-category .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

.tools-by-category .tool-card-link {
  padding: 0.85rem 0.95rem;
  gap: 0.2rem;
  border-radius: var(--radius-sm);
  min-height: 0;
}

.tools-by-category .tool-card-link:hover {
  transform: translateY(-3px);
}

.tools-by-category .tool-card-icon {
  font-size: 1.375rem;
  margin-bottom: 0.15rem;
  line-height: 1;
}

.tools-by-category .tool-card-link:hover .tool-card-icon {
  transform: scale(1.08) rotate(-4deg);
}

.tools-by-category .tool-card-link h3,
.tools-by-category .tool-card-link h4 {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.tools-by-category .tool-card-link p {
  font-size: 0.75rem;
  line-height: 1.45;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tools-by-category .tool-card-cta {
  font-size: 0.75rem;
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tool-card-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.tool-card-link:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: inherit;
}

.tool-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.tool-card-link:hover .tool-card-icon {
  transform: scale(1.12) rotate(-6deg);
}

.tool-card-link h3 {
  font-size: 1.1875rem;
  font-weight: 700;
}

.tool-card-link p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.tool-card-cta {
  margin-top: auto;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9375rem;
  transition: transform 0.2s var(--ease);
}

.tool-card-link:hover .tool-card-cta {
  transform: translateX(3px);
}

.tool-card-soon {
  cursor: default;
  background: var(--surface-2);
  border-style: dashed;
}

.tool-card-soon:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.tool-card-soon .tool-card-cta {
  color: var(--text-soft);
}

.tool-card-soon:hover .tool-card-icon,
.tool-card-soon:hover .tool-card-cta {
  transform: none;
}

/* ---------- More tools CTA (tool pages) ---------- */
.more-tools-cta {
  padding: 2.5rem 0 3rem;
  text-align: center;
}

.more-tools-cta .container {
  display: flex;
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text);
  color: #cfd4e2;
  padding: 2rem 0 1.35rem;
}

.footer-grid {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand-col {
  flex: 0 0 auto;
  width: min(200px, 32vw);
}

.footer-col-tools {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 960px) {
  .footer-grid {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-brand-col {
    width: 100%;
    max-width: 280px;
  }
}

.site-footer .brand {
  color: #fff;
  margin-bottom: 0.55rem;
}

.footer-tagline {
  color: #99a1b7;
  max-width: none;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.footer-col h3 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b93a7;
  margin-bottom: 0.55rem;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-col a {
  color: #cfd4e2;
  font-size: 0.9375rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-tools-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}

.footer-tools-group-title {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8b93a7;
  margin-bottom: 0.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.footer-tools-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-tools-group-list a {
  color: #cfd4e2;
  font-size: 0.75rem;
  line-height: 1.3;
  display: inline-block;
}

.footer-tools-group-list a:hover {
  color: #fff;
}

.footer-tools-group--collapsible.is-collapsed .footer-tools-group-list li:nth-child(n+6) {
  display: none;
}

.footer-tools-more {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  color: #99a1b7;
  cursor: pointer;
  text-align: left;
}

.footer-tools-more:hover {
  color: #fff;
}

@media (max-width: 960px) {
  .footer-tools-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.85rem;
  }
}

@media (max-width: 720px) {
  .footer-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }
}

.footer-bottom {
  padding-top: 1rem;
  text-align: center;
}

.copyright {
  color: #737b90;
  font-size: 0.8125rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.footer-legal a {
  color: #cfd4e2;
  font-size: 0.875rem;
  font-weight: 500;
}

.footer-legal a:hover {
  color: #fff;
}

.footer-legal-sep {
  color: #737b90;
}

.footer-operator {
  margin-top: 0.35rem;
  color: #737b90;
  font-size: 0.75rem;
}

/* ---------- Legal pages ---------- */
.legal-page {
  padding: 2rem 0 4rem;
}

.legal-prose {
  max-width: 760px;
  margin: 0 auto;
}

.legal-prose h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.legal-meta {
  color: var(--text-soft);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.legal-prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  text-align: left;
  color: var(--text);
}

.legal-prose h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 1.35rem 0 0.55rem;
  color: var(--text);
}

.legal-prose p,
.legal-prose li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-prose p {
  margin-bottom: 1rem;
}

.legal-prose ul {
  margin: 0 0 1rem 1.25rem;
}

.legal-prose li {
  margin-bottom: 0.45rem;
}

.legal-prose a {
  color: var(--accent);
  font-weight: 500;
}

.legal-prose a:hover {
  text-decoration: underline;
}

.legal-prose strong {
  color: var(--text);
  font-weight: 600;
}

.legal-address {
  font-style: normal;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.contact-card {
  margin: 1.5rem 0 2rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.contact-card h2 {
  margin-top: 0;
}

.contact-email {
  margin: 0.75rem 0 1rem;
}

.contact-email a {
  font-size: 1.125rem;
  font-weight: 700;
}

.contact-note {
  font-size: 0.9375rem;
  color: var(--text-soft);
  margin-bottom: 0;
}

/* ---------- Cookie consent banner ---------- */
body.has-cookie-banner {
  padding-bottom: 5.5rem;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(23, 26, 38, 0.1);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.cookie-banner-inner {
  max-width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.cookie-banner-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  flex: 1 1 280px;
}

.cookie-banner-text a {
  color: var(--accent);
  font-weight: 600;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  body.has-cookie-banner {
    padding-bottom: 7.5rem;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .btn {
    flex: 1;
  }
}

/* ---------- Free badge ---------- */
.eyebrow-free {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

/* ---------- Ads ---------- */
.ad-slot,
.ad-rail {
  --ad-muted: #aab2c5;
}

.ad-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.65;
  margin-bottom: 0.35rem;
  text-align: center;
}

.ad-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(
      45deg,
      var(--surface-2),
      var(--surface-2) 12px,
      var(--bg-alt) 12px,
      var(--bg-alt) 24px
    );
  color: var(--ad-muted);
  font-size: 0.8125rem;
  text-align: center;
  overflow: hidden;
}

.ad-placeholder {
  padding: 0.5rem 0.75rem;
  line-height: 1.4;
}

/* In-content horizontal banner */
.ad-banner {
  margin: 2.5rem auto;
  max-width: 970px;
}

.ad-banner .ad-frame {
  width: 100%;
  min-height: 90px;
}

/* Mobile tool-page banner — between intro copy and the tool (≤860px) */
.ad-mobile-banner {
  display: none;
  margin: 0 auto 1.25rem;
  max-width: 100%;
}

.ad-mobile-banner .ad-frame {
  min-height: 100px;
}

@media (max-width: 860px) {
  body[data-uzetool-page] .ad-mobile-banner {
    display: block;
  }

  /* Sidebar rectangle stacks below the tool on mobile — hide when mobile banner is shown */
  body[data-uzetool-page] .tool .sidebar .ad-rectangle {
    display: none;
  }
}

/* Sidebar rectangle (300×250) — highest-value slot, sits beside the tool */
.ad-rectangle .ad-frame {
  width: 100%;
  max-width: 300px;
  height: 250px;
  margin: 0 auto;
}

/* Fixed side rails — pinned below the sticky header so they work in windowed
   browsers (Safari, etc.) where viewport height drops once chrome/menu bar return.
   Height shrinks on short windows instead of hiding entirely. */
.ad-rail {
  display: none;
  position: fixed;
  top: 80px;
  z-index: 60;
  width: 100px;
  height: min(600px, calc(100vh - 96px));
  --rail-width: 100px;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease), height 0.15s var(--ease);
}

.ad-rail .ad-frame {
  width: 100%;
  height: 100%;
  min-height: 180px;
}

.ad-rail-left {
  left: max(0.5rem, calc((100vw - 1120px) / 2 - var(--rail-width) - 8px));
}

.ad-rail-right {
  right: max(0.5rem, calc((100vw - 1120px) / 2 - var(--rail-width) - 8px));
}

.ad-rail-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Horizontal fallback banner: shown by default, hidden when vertical rails fit */
.ad-rail-fallback {
  display: block;
}

/* 100px rails — need ~1340px so each gutter fits rail + gap beside 1120px content */
@media (min-width: 1340px) {
  .ad-rail {
    display: block;
  }
  .ad-rail-fallback {
    display: none;
  }
}

@media (min-width: 1380px) {
  .ad-rail {
    width: 120px;
    --rail-width: 120px;
  }
}

@media (min-width: 1460px) {
  .ad-rail {
    width: 160px;
    --rail-width: 160px;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--text);
  color: #fff;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 404 page ---------- */
.error-page {
  min-height: calc(100vh - 68px - 200px);
  display: flex;
  align-items: center;
  padding: 4rem 0 5rem;
}

.error-content {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.error-code {
  font-size: clamp(4rem, 12vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}

.error-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.error-lede {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 1.75rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.error-tools {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.error-tools h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.85rem;
}

.error-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.error-tools-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.error-tools-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateX(4px);
}

.error-tools-link span:first-child {
  font-size: 1.25rem;
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 860px) {
  .section {
    padding: 3.5rem 0;
  }
  .section-head {
    margin-bottom: 2rem;
  }
  .tool {
    padding: 1.1rem;
  }
  /* On stacked layout the sidebar rectangle ad sits full-width; keep it tidy */
  .ad-rectangle .ad-frame {
    max-width: 336px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.15rem;
  }
  .site-header {
    --header-h: 60px;
  }
  .header-inner {
    height: var(--header-h);
    gap: 0.75rem;
    min-width: 0;
  }
  .site-nav {
    gap: 0.65rem;
    flex-shrink: 0;
  }
  .site-nav .btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
  }
  .brand {
    font-size: 1.0625rem;
  }
  .hero {
    padding: 1.75rem 0 2.25rem;
  }
  .home-hero {
    padding: 2.5rem 0 2rem;
  }
  .hero-copy {
    margin-bottom: 1.5rem;
  }
  .lede {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    width: 100%;
  }
  .section {
    padding: 3rem 0;
  }
  .section-head {
    margin-bottom: 1.75rem;
  }
  .section-head p {
    font-size: 1rem;
  }
  .tool {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  /* Tighter hero on tool pages — get to the calculator faster */
  .hero:has(.tool) {
    padding: 1.35rem 0 1.65rem;
  }

  .hero:has(.tool) .hero-copy {
    margin-bottom: 1rem;
  }

  .hero:has(.tool) h1 {
    font-size: clamp(1.5rem, 6.5vw, 2.15rem);
  }

  .hero:has(.tool) .breadcrumb {
    margin-bottom: 0.65rem;
  }

  .ac-panel {
    min-height: 0;
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .drop-zone {
    padding: 2.5rem 1.25rem;
    min-height: 240px;
  }
  .drop-zone h2 {
    font-size: 1.125rem;
  }
  .step-card {
    padding: 1.5rem 1.35rem;
  }
  .feature-card {
    padding: 1.35rem;
  }
  .prose h2 {
    font-size: 1.5rem;
  }
  .prose p {
    font-size: 1rem;
  }
  .faq-item {
    padding: 0 1.15rem;
  }
  .faq-item summary {
    font-size: 1rem;
    padding: 1rem 1.75rem 1rem 0;
  }
  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .error-actions .btn {
    width: 100%;
  }
  .ad-banner {
    margin: 1.75rem auto;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 0 0.9rem;
  }
  .footer-brand-col {
    max-width: none;
  }
  .color-value-row label {
    width: 2.25rem;
  }
}


/* ---------- Scientific Calculator tool ---------- */
.sc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .sc-layout {
    grid-template-columns: 1fr;
  }
}

/* --- Physical calculator device --- */
.sc-device {
  --sc-cap-light: linear-gradient(180deg, #fbfbfd 0%, #e5e8ef 100%);
  --sc-cap-dark: linear-gradient(180deg, #464c5b 0%, #333846 100%);
  max-width: 440px;
  margin: 0 auto;
  padding: 1.15rem 1.15rem 1.4rem;
  border-radius: 26px;
  background:
    radial-gradient(140% 120% at 50% 0%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #333a49 0%, #262b37 55%, #1d2129 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4),
    0 22px 48px rgba(15, 18, 26, 0.4),
    0 6px 14px rgba(15, 18, 26, 0.28);
}

.sc-device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.1rem 0.35rem 0.9rem;
}

.sc-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sc-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f2f4f8;
}

.sc-brand-model {
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(226, 232, 240, 0.5);
}

.sc-solar {
  display: flex;
  gap: 3px;
  padding: 4px 5px;
  border-radius: 5px;
  background: linear-gradient(180deg, #1a1d25 0%, #0f1218 100%);
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.sc-solar i {
  width: 13px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3a4256 0%, #2a3040 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* --- LCD screen --- */
.sc-screen {
  position: relative;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 12px;
  background: linear-gradient(170deg, #d3ddca 0%, #c3d0ba 55%, #b7c6ad 100%);
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 2px 6px rgba(40, 55, 35, 0.35),
    inset 0 -1px 2px rgba(255, 255, 255, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sc-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(30, 45, 25, 0.03) 0px,
    rgba(30, 45, 25, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

.sc-indicators {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sc-ind {
  color: rgba(31, 42, 28, 0.28);
  transition: color 0.15s var(--ease), text-shadow 0.15s var(--ease);
}

.sc-ind-on {
  color: #26331f;
  text-shadow: 0 0 1px rgba(38, 51, 31, 0.4);
}

.sc-screen-body {
  position: relative;
  z-index: 1;
  min-height: 3.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sc-expression {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  font-weight: 500;
  line-height: 1.4;
  color: rgba(31, 42, 28, 0.72);
  word-break: break-all;
  text-align: right;
  min-height: 1.4em;
}

.sc-result {
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: #1c2718;
  text-align: right;
  min-height: 1.2em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sc-result-error {
  color: #a33228;
  font-size: 0.9375rem;
  font-weight: 700;
}

.sc-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid rgba(31, 42, 28, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.28);
  color: rgba(31, 42, 28, 0.55);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sc-copy:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #26331f;
}

/* --- Keypad --- */
.sc-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.sc-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  min-height: 3rem;
  padding: 0.3rem 0.2rem 0.42rem;
  border: none;
  border-radius: 10px;
  background: var(--sc-cap-dark);
  color: #eef1f6;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 3px rgba(0, 0, 0, 0.32),
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 4px 7px rgba(0, 0, 0, 0.3);
  transition: transform 0.05s ease, box-shadow 0.05s ease, filter 0.15s var(--ease);
}

.sc-btn:hover {
  filter: brightness(1.08);
}

.sc-btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.35),
    0 0 0 rgba(0, 0, 0, 0.35);
}

.sc-key-main {
  line-height: 1.05;
}

.sc-key-2nd {
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f0a93a;
  min-height: 0.7rem;
}

/* Number keys — light caps */
.sc-btn-num {
  background: var(--sc-cap-light);
  color: #232733;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 3px rgba(120, 130, 150, 0.35),
    0 3px 0 rgba(150, 158, 175, 0.55),
    0 4px 7px rgba(30, 40, 60, 0.18);
}

.sc-btn-num:active {
  box-shadow:
    inset 0 1px 2px rgba(120, 130, 150, 0.4),
    0 0 0 rgba(0, 0, 0, 0.2);
}

/* Function keys — dark caps (default .sc-btn look) */
.sc-btn-fn .sc-key-main {
  font-size: 0.85rem;
  color: #e7ebf2;
}

/* Operator keys — accent tint */
.sc-btn-op {
  background: linear-gradient(180deg, #5b52c9 0%, #4a41ad 100%);
  color: #fff;
}

.sc-btn-op .sc-key-main {
  font-size: 1.2rem;
  font-weight: 700;
}

/* 2nd (shift) key */
.sc-btn-shift {
  background: linear-gradient(180deg, #f2b24a 0%, #e0952b 100%);
  color: #2a1e08;
}

.sc-btn-shift .sc-key-main {
  font-weight: 800;
}

.sc-btn-shift[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffd27a 0%, #f2a63a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(120, 70, 0, 0.4),
    0 0 0 2px rgba(240, 169, 58, 0.4),
    0 3px 0 rgba(150, 90, 0, 0.4);
}

/* Angle mode key */
.sc-btn-mode .sc-key-main {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8fd0ff;
}

/* Clear / delete */
.sc-btn-clear {
  background: linear-gradient(180deg, #e5615a 0%, #cf4139 100%);
  color: #fff;
}

.sc-btn-clear .sc-key-main,
.sc-btn-del .sc-key-main {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sc-btn-del {
  background: linear-gradient(180deg, #565d6e 0%, #3f4451 100%);
}

/* Equals */
.sc-btn-eq {
  background: linear-gradient(180deg, #6d5efc 0%, #5a3ff0 100%);
  color: #fff;
}

.sc-btn-eq .sc-key-main {
  font-size: 1.4rem;
  font-weight: 800;
}

/* 2nd-active state: highlight the amber sub-labels */
.sc-keypad.sc-2nd-on .sc-key-2nd {
  color: #ffd27a;
  text-shadow: 0 0 6px rgba(240, 169, 58, 0.5);
}

/* --- Sidebar cards --- */
.sc-history-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sc-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 240px;
  overflow-y: auto;
}

.sc-history-empty {
  margin: 0;
  padding: 0.4rem 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.sc-history-item {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.sc-history-item:hover {
  background: var(--accent-soft);
  border-color: rgba(109, 94, 252, 0.22);
}

.sc-history-expr {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
}

.sc-history-result {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.sc-shortcuts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sc-shortcuts kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 520px) {
  .sc-device {
    padding: 0.9rem 0.85rem 1.1rem;
    border-radius: 20px;
  }

  .sc-keypad {
    gap: 0.4rem;
  }

  .sc-btn {
    min-height: 2.85rem;
    border-radius: 9px;
  }

  .sc-btn-num {
    font-size: 1.05rem;
  }
}

/* ---------- Life in Weeks Visualizer ---------- */
.liw-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .liw-layout {
    grid-template-columns: 1fr;
  }
}

.liw-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 1.5rem 1.35rem;
}

.liw-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.liw-summary {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

.liw-summary strong {
  color: var(--accent);
  font-weight: 700;
}

.liw-grid-wrap {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.85rem;
  overflow-x: auto;
}

.liw-grid {
  display: grid;
  grid-template-columns: repeat(52, minmax(4px, 1fr));
  gap: 2px;
  min-width: 520px;
}

@media (max-width: 640px) {
  .ac-panel:has(.liw-grid) {
    min-height: 0;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .liw-grid-wrap {
    padding: 0.5rem;
    overflow-x: visible;
  }

  .liw-grid {
    min-width: 0;
    width: 100%;
    gap: 1px;
    grid-template-columns: repeat(52, minmax(0, 1fr));
  }

  .liw-week {
    border-radius: 1px;
  }

  .liw-week-current {
    transform: scale(1.05);
  }

  .liw-stats {
    gap: 0.5rem;
  }

  .liw-stat {
    padding: 0.65rem 0.5rem;
  }

  .liw-stat-val {
    font-size: 1.05rem;
  }

  .ac-result.liw-summary {
    font-size: 0.875rem;
  }
}

.liw-week {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(109, 94, 252, 0.08);
  border: 1px solid rgba(109, 94, 252, 0.06);
  transition: transform 0.1s var(--ease);
}

.liw-week-lived {
  background: var(--accent);
  border-color: rgba(109, 94, 252, 0.35);
}

.liw-week-current {
  background: #f0a93a;
  border-color: #d9922a;
  box-shadow: 0 0 0 2px rgba(240, 169, 58, 0.35);
  transform: scale(1.15);
  z-index: 1;
}

.liw-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.liw-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.liw-stat {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
}

.liw-stat-val {
  display: block;
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.liw-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.liw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.liw-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.liw-legend i {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.liw-legend-lived i {
  background: var(--accent);
}

.liw-legend-current i {
  background: #f0a93a;
}

.liw-legend-future i {
  background: rgba(109, 94, 252, 0.08);
  border: 1px solid rgba(109, 94, 252, 0.12);
}

/* ---------- Boss Toilet Calculator ---------- */
.btc-layout,
.sps-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .btc-layout,
  .sps-layout {
    grid-template-columns: 1fr;
  }
}

.btc-panel,
.sps-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.btc-counter-wrap,
.sps-counter-wrap {
  margin: 1.25rem 0 1rem;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.08) 0%, rgba(109, 94, 252, 0.02) 100%);
  border: 1px solid rgba(109, 94, 252, 0.15);
}

.btc-counter,
.sps-counter {
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.btc-counter-label,
.sps-counter-label {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btc-meta,
.sps-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btc-meta strong,
.sps-meta strong {
  color: var(--text);
  font-family: var(--mono);
}

.btc-actions,
.sps-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

#btc-toggle.is-active,
#sps-toggle.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btc-status,
.sps-status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btc-rate-grid,
.sps-rate-grid,
.btc-rates,
.sps-rates {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}

.btc-rate-row,
.sps-rate-row,
.btc-rate-item,
.sps-rate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.8125rem;
}

.btc-rate-row span,
.sps-rate-row span,
.btc-rate-label,
.sps-rate-label {
  color: var(--text-muted);
}

.btc-rate-row strong,
.sps-rate-row strong,
.btc-rate-val,
.sps-rate-val {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 640px) {
  body[data-uzetool-page="boss-toilet-calculator"] .hero {
    padding: 1.35rem 0 1.5rem;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .hero-copy {
    margin-bottom: 1rem;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .tool {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-panel {
    padding: 1.5rem 1.15rem;
    text-align: center;
    border: none;
    border-radius: 1.25rem;
    background: linear-gradient(165deg, #fff 0%, rgba(109, 94, 252, 0.06) 100%);
    box-shadow: 0 12px 40px rgba(109, 94, 252, 0.14);
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-counter-wrap {
    margin: 1rem 0;
    padding: 1.75rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(109, 94, 252, 0.14) 0%, rgba(109, 94, 252, 0.05) 100%);
    border: 1px solid rgba(109, 94, 252, 0.2);
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-counter {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
    word-break: break-word;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-rates {
    gap: 0.5rem;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-rate-item {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.7);
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-actions .btn {
    width: 100%;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .btc-status {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  body[data-uzetool-page="boss-toilet-calculator"] .ac-field {
    text-align: left;
  }
}

/* ---------- Phone Life Estimator ---------- */
.ple-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 860px) {
  .ple-layout {
    grid-template-columns: 1fr;
  }
}

.ple-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 1.75rem 1.5rem;
}

.ple-headline {
  margin: 0 0 1.25rem;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
}

.ple-headline strong {
  color: var(--accent);
}

.ple-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ple-details li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.875rem;
}

.ple-details li span {
  color: var(--text-muted);
}

.ple-details li strong {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.ple-range-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ple-range-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.ple-range-val {
  min-width: 2.5rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent);
  text-align: right;
}

.ple-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ple-tips li::before {
  content: "→ ";
  color: var(--accent);
  font-weight: 700;
}

.liw-expectancy-val,
.ple-hours-val,
.ple-expectancy-val {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
}

.ac-result.liw-summary {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.ac-result.liw-summary strong {
  color: var(--accent);
  font-weight: 700;
}

.sps-period-select {
  flex: 0 0 auto;
  min-width: 7.5rem;
  max-width: 9rem;
}

.ple-details li strong {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Fake Tip Screen Simulator ---------- */
.fts-tip-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.25rem 0 0.5rem;
}

.fts-tip-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.fts-tip-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fts-preset-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.fts-preset-field {
  position: relative;
  display: block;
}

.fts-preset-field .fts-preset-input {
  width: 100%;
  padding-right: 1.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fts-preset-suffix {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
}

.fts-tip-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fts-custom-wrap {
  margin-top: 0.15rem;
}

.fts-pos-preview {
  margin-top: 0.5rem;
  padding: 0;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}

.fts-pos-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 2rem 1.75rem 1.75rem;
  background: #fff;
  color: #000;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.fts-pos-bill {
  text-align: center;
  margin-bottom: clamp(0.75rem, 2.5vh, 1.25rem);
}

.fts-pos-bill-amt {
  font-size: clamp(1.75rem, 5.5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #000;
  font-variant-numeric: tabular-nums;
}

.fts-pos-screen--fullscreen {
  width: min(100%, 560px);
  padding: clamp(2rem, 8vh, 4rem) clamp(1.25rem, 5vw, 2.5rem);
}

.fts-pos-title {
  margin: 0 0 clamp(1.25rem, 4vh, 2rem);
  text-align: center;
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #000;
}

.fts-pos-tip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.fts-pos-tip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: clamp(4.5rem, 16vw, 6.5rem);
  margin: 0;
  padding: 0.65rem 0.5rem;
  border: none;
  border-radius: 0;
  background: #007aff;
  color: #fff;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#fts-overlay .fts-pos-tip-btn:active {
  background: #0065d1;
}

.fts-pos-tip-pct {
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  line-height: 1;
}

.fts-pos-tip-amt {
  font-size: clamp(0.8125rem, 2.2vw, 1rem);
  font-weight: 400;
  opacity: 0.92;
  font-variant-numeric: tabular-nums;
}

.fts-pos-tip-custom {
  width: 100%;
  min-height: clamp(3.25rem, 11vw, 4.5rem);
  margin-top: 0;
}

.fts-pos-tip-custom .fts-pos-tip-pct {
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
}

.fts-pos-tip-btn.is-active {
  background: #0065d1;
}

.fts-fs-proceed {
  width: 100%;
  min-height: clamp(3.25rem, 11vw, 4.5rem);
  margin-top: 0;
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
}

.fts-fs-proceed .fts-pos-tip-pct,
.fts-fs-proceed {
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
}

.fts-fs-custom {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
}

.fts-fs-custom[hidden] {
  display: none !important;
}

.fts-fs-custom-sheet {
  width: min(100%, 360px);
  padding: 1.5rem 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.fts-fs-custom-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 400;
  color: #000;
}

.fts-fs-custom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.fts-fs-custom-input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0;
  font-size: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fts-fs-custom-pct {
  font-size: 1.5rem;
  color: #000;
}

.fts-fs-custom-confirm {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.125rem;
}

.fts-fs-processing {
  width: 100%;
  min-height: 100%;
  padding: 1.5rem;
  background: #fff;
}

.fts-processing-inner {
  width: min(100%, 420px);
  text-align: center;
}

.fts-processing-spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 1.25rem;
  border: 3px solid rgba(0, 122, 255, 0.18);
  border-top-color: #007aff;
  border-radius: 50%;
  animation: fts-spin 0.85s linear infinite;
}

@keyframes fts-spin {
  to { transform: rotate(360deg); }
}

.fts-processing-msg {
  margin: 0 0 1.25rem;
  font-size: clamp(1.125rem, 4vw, 1.375rem);
  font-weight: 400;
  color: #000;
}

.fts-processing-sub {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.55);
}

.fts-processing-bar-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}

.fts-processing-bar-fill {
  width: 0%;
  height: 100%;
  background: #007aff;
  transition: width 0.15s linear;
}

.fts-actions {
  margin-top: 0.25rem;
}

.fts-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.fts-disclaimer kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

/* Fullscreen POS overlay */
.fts-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  padding: 0;
  background: #fff;
  color: #000;
}

.fts-fs-pos,
.fts-fs-custom,
.fts-fs-processing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fts-fs-pos[hidden],
.fts-fs-custom[hidden],
.fts-fs-processing[hidden],
.fts-fs-proceed[hidden] {
  display: none !important;
}

.fts-overlay .fts-fs-pos,
.fts-overlay .fts-fs-processing {
  flex: none;
}

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

.fts-overlay-fallback {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.fts-fs-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 1rem;
  background: #fff;
}

.fts-fs-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.fts-fs-close:hover {
  background: #fff;
  color: var(--text);
}

.fts-overlay:fullscreen .fts-fs-close,
.fts-overlay:-webkit-full-screen .fts-fs-close {
  display: none !important;
}

/* ---------- Fake Update Screen ---------- */
.fus-os-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.fus-os-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.fus-os-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fus-os-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fus-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fus-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.fus-preview {
  position: relative;
  min-height: 220px;
  padding: 2rem 1.5rem 1.35rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.fus-preview[data-os="windows"] {
  background: #0078d4;
}

.fus-preview[data-os="mac"] {
  background: #1d1d1f;
}

.fus-preview-windows,
.fus-preview-mac {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.fus-preview[data-os="windows"] .fus-preview-mac {
  display: none;
}

.fus-preview[data-os="mac"] .fus-preview-windows {
  display: none;
}

.fus-preview-apple {
  width: 2.5rem;
  height: 2.5rem;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='black' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.3 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.9 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90.9-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='black' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.3 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.9 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90.9-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fus-preview-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.fus-preview-sub {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0.88;
  max-width: 28rem;
}

.fus-preview-bar-track {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 2.5rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.fus-preview-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 0.8s ease;
}

.fus-preview-pct {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.85rem;
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.85;
}

.fus-actions {
  margin-top: 0.25rem;
}

.fus-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.fus-disclaimer kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

/* Fullscreen update overlay */
.fus-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
}

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

.fus-overlay-fallback {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.fus-overlay[data-os="windows"] {
  background: #0078d4;
}

.fus-overlay[data-os="mac"] {
  background: #1d1d1f;
}

.fus-fs-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.fus-fs-close:hover {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.fus-overlay:not([hidden]) .fus-fs-close {
  display: none !important;
}

.fus-overlay.is-cursor-idle:fullscreen,
.fus-overlay.is-cursor-idle:-webkit-full-screen,
.fus-overlay.is-cursor-idle.fus-overlay-fallback,
.fus-overlay.is-cursor-idle,
.fus-overlay.is-cursor-idle * {
  cursor: none !important;
}

.fus-fs-windows,
.fus-fs-mac {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 6rem;
}

.fus-overlay[data-os="windows"] .fus-fs-mac {
  display: none;
}

.fus-overlay[data-os="mac"] .fus-fs-windows {
  display: none;
}

.fus-fs-win-inner,
.fus-fs-mac-inner {
  max-width: 36rem;
  text-align: center;
}

.fus-fs-apple {
  width: clamp(3rem, 8vw, 4.5rem);
  height: clamp(3rem, 8vw, 4.5rem);
  margin: 0 auto 1.25rem;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='black' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.3 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.9 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90.9-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='black' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.3 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.9 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90.9-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fus-fs-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
}

.fus-fs-sub {
  margin: 0;
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  line-height: 1.45;
  opacity: 0.9;
}

.fus-fs-sub-small {
  margin-top: 0.45rem;
  font-size: 0.875rem;
  opacity: 0.75;
}

.fus-fs-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1.5rem 1.75rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.12) 100%);
}

.fus-fs-bar-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.fus-fs-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 0.8s ease;
}

.fus-fs-pct {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  opacity: 0.88;
  text-align: left;
}

/* ---------- Cracked Screen Prank ---------- */
.csp-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.csp-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.csp-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.csp-preview-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  max-height: 220px;
  overflow: hidden;
}


.csp-preview-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.csp-preview-wallpaper {
  position: absolute;
  inset: 0;
  background: #004477;
}

.csp-preview-icon {
  display: none;
}

.csp-crack-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.csp-crack-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.csp-actions {
  margin-top: 0.25rem;
}

.csp-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.csp-disclaimer kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

.csp-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #004477;
  overflow: hidden;
}

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

.csp-overlay-fallback {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.csp-crack-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.csp-fs-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s var(--ease);
}

.csp-fs-close:hover {
  background: rgba(0, 0, 0, 0.65);
}

.csp-overlay:not([hidden]) .csp-fs-close {
  display: none !important;
}

.csp-overlay.is-cursor-idle:fullscreen,
.csp-overlay.is-cursor-idle:-webkit-full-screen,
.csp-overlay.is-cursor-idle.csp-overlay-fallback,
.csp-overlay.is-cursor-idle,
.csp-overlay.is-cursor-idle * {
  cursor: none !important;
}

@keyframes csp-flash-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

.csp-flash {
  position: absolute;
  z-index: 2;
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 68%);
  animation: csp-flash-pulse 0.42s ease-out forwards;
}

/* ---------- Fake Loading Screen Generator ---------- */
.fls-theme-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.fls-theme-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.fls-theme-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fls-theme-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fls-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fls-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.fls-preview {
  min-height: 180px;
  padding: 2rem 1.5rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.fls-preview[data-theme="minimal"] {
  background: #fff;
  color: #171a26;
}

.fls-preview[data-theme="corporate"] {
  background: linear-gradient(180deg, #f4f7fc 0%, #e8eef8 100%);
  color: #1a2744;
  border-color: #c8d4ea;
}

.fls-preview[data-theme="retro"] {
  background: #0a0f0a;
  color: #33ff66;
  border-color: #1a4028;
  font-family: var(--mono);
}

.fls-preview[data-theme="dark"] {
  background: #12141a;
  color: #eef1f6;
  border-color: #2a2f3a;
}

.fls-preview-msg {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.fls-preview-bar-track {
  width: min(100%, 320px);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.fls-preview[data-theme="minimal"] .fls-preview-bar-track {
  background: #e3e7f0;
}

.fls-preview[data-theme="corporate"] .fls-preview-bar-track {
  background: #c8d4ea;
}

.fls-preview[data-theme="retro"] .fls-preview-bar-track {
  background: #14331f;
  height: 10px;
  border: 1px solid #33ff66;
}

.fls-preview[data-theme="dark"] .fls-preview-bar-track {
  background: #2a2f3a;
}

.fls-preview-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.15s linear;
}

.fls-preview[data-theme="minimal"] .fls-preview-bar-fill {
  background: var(--accent-grad);
}

.fls-preview[data-theme="corporate"] .fls-preview-bar-fill {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
}

.fls-preview[data-theme="retro"] .fls-preview-bar-fill {
  background: #33ff66;
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.45);
}

.fls-preview[data-theme="dark"] .fls-preview-bar-fill {
  background: linear-gradient(90deg, #6d5efc 0%, #9b6bff 100%);
}

.fls-preview-pct {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  opacity: 0.85;
}

.fls-actions {
  margin-top: 0.25rem;
}

.fls-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.fls-disclaimer kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

/* Fullscreen loading overlay */
.fls-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.fls-overlay-fallback {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.fls-overlay[data-theme="minimal"] {
  background: #fff;
  color: #171a26;
}

.fls-overlay[data-theme="corporate"] {
  background: linear-gradient(180deg, #f4f7fc 0%, #e8eef8 100%);
  color: #1a2744;
}

.fls-overlay[data-theme="retro"] {
  background: #0a0f0a;
  color: #33ff66;
  font-family: var(--mono);
}

.fls-overlay[data-theme="dark"] {
  background: #12141a;
  color: #eef1f6;
}

.fls-fs-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
  color: inherit;
  opacity: 0.65;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease);
}

.fls-fs-close:hover {
  opacity: 1;
  background: rgba(127, 127, 127, 0.2);
}

.fls-overlay:not([hidden]) .fls-fs-close {
  display: none !important;
}

.fls-overlay.is-cursor-idle:fullscreen,
.fls-overlay.is-cursor-idle:-webkit-full-screen,
.fls-overlay.is-cursor-idle.fls-overlay-fallback,
.fls-overlay.is-cursor-idle,
.fls-overlay.is-cursor-idle * {
  cursor: none !important;
}

.fls-fs-inner {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.fls-fs-msg {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.4;
}

.fls-fs-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}

.fls-overlay[data-theme="minimal"] .fls-fs-bar-track {
  background: #e3e7f0;
}

.fls-overlay[data-theme="corporate"] .fls-fs-bar-track {
  background: #c8d4ea;
}

.fls-overlay[data-theme="retro"] .fls-fs-bar-track {
  background: #14331f;
  height: 12px;
  border: 1px solid #33ff66;
}

.fls-overlay[data-theme="dark"] .fls-fs-bar-track {
  background: #2a2f3a;
}

.fls-fs-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.15s linear;
}

.fls-overlay[data-theme="minimal"] .fls-fs-bar-fill {
  background: var(--accent-grad);
}

.fls-overlay[data-theme="corporate"] .fls-fs-bar-fill {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
}

.fls-overlay[data-theme="retro"] .fls-fs-bar-fill {
  background: #33ff66;
  box-shadow: 0 0 12px rgba(51, 255, 102, 0.45);
}

.fls-overlay[data-theme="dark"] .fls-fs-bar-fill {
  background: linear-gradient(90deg, #6d5efc 0%, #9b6bff 100%);
}

.fls-fs-pct {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  opacity: 0.85;
}

@media (max-width: 560px) {
  .fts-pos-screen {
    padding: 2rem 1.25rem 1.5rem;
  }

  .fts-preset-inputs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .fus-preview,
  .fls-preview {
    min-height: 180px;
    padding: 1.5rem 1rem 1rem;
  }

  .fus-preview-bar-track {
    left: 1rem;
    right: 1rem;
    bottom: 2.25rem;
  }

  .fus-fs-progress {
    padding: 1rem 1rem 1.35rem;
  }
}

/* ---------- Score & skill test tools (shared) ---------- */
.score-layout {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 1.25rem;
  align-items: start;
}

.score-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.score-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.score-stat-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.score-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.score-stat-val {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--mono);
  color: var(--text);
  line-height: 1.1;
}

.score-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.score-arena {
  position: relative;
  min-height: 220px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

.score-arena-label,
.score-hint {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 0 1rem;
}

.score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.score-dur-row,
.score-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.score-dur-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.score-dur-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.score-tips {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.score-history {
  padding-top: 0.25rem;
}

.score-history-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.score-history-rank {
  color: var(--text-soft);
  font-weight: 600;
}

.score-history-val {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

/* Reaction time test */
.rtt-arena[data-state="idle"] {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
}

.rtt-arena[data-state="waiting"] {
  background: #c0392b;
  border-color: #962d22;
}

.rtt-arena[data-state="waiting"] .score-arena-label {
  color: rgba(255, 255, 255, 0.92);
}

.rtt-arena[data-state="ready"] {
  background: #27ae60;
  border-color: #1e8449;
}

.rtt-arena[data-state="ready"] .score-arena-label {
  color: #fff;
  font-size: 1.25rem;
}

.rtt-arena[data-state="early"] {
  background: #e67e22;
  border-color: #d35400;
}

.rtt-arena[data-state="early"] .score-arena-label,
.rtt-arena[data-state="result"] .score-arena-label {
  color: #fff;
}

.rtt-arena[data-state="result"] {
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.15) 0%, var(--surface-2) 100%);
  border-color: rgba(109, 94, 252, 0.35);
}

/* CPS test */
.cps-arena.is-active {
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.12) 0%, var(--surface-2) 100%);
  border-color: rgba(109, 94, 252, 0.35);
}

.cps-arena[data-state="done"],
.aim-arena[data-state="done"] {
  cursor: default;
}

.cps-arena.is-active .score-arena-label {
  color: var(--accent);
}

.score-arena-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(247, 248, 252, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

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

.score-arena-result {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
}

.score-dur-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.score-dur-input {
  width: 4.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
}

.score-dur-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Typing speed test */
.tst-target-wrap {
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 5.5rem;
}

.tst-target {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  word-break: break-word;
}

.tst-char {
  transition: color 0.1s var(--ease), background 0.1s var(--ease);
}

.tst-char-ok {
  color: var(--text);
}

.tst-char-bad {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.12);
  border-radius: 2px;
}

.tst-char-cursor {
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}

.tst-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 6rem;
}

.tst-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Spacebar counter */
.sbc-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px dashed rgba(109, 94, 252, 0.35);
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.06) 0%, var(--surface-2) 100%);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

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

.sbc-display:active {
  transform: scale(0.99);
}

.sbc-count {
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  font-family: var(--mono);
  color: var(--accent);
  line-height: 1;
}

.sbc-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Aim trainer */
.aim-arena {
  min-height: 280px;
  background:
    radial-gradient(circle at 20% 20%, rgba(109, 94, 252, 0.08) 0%, transparent 45%),
    var(--surface-2);
}

.aim-arena.is-active {
  border-color: rgba(109, 94, 252, 0.35);
  cursor: crosshair;
}

.aim-target {
  position: absolute;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff6b6b 0%, #e74c3c 55%, #c0392b 100%);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.45);
  cursor: pointer;
  animation: aim-pop 0.18s var(--ease);
}

.aim-target:hover {
  transform: scale(1.06);
}

@keyframes aim-pop {
  from {
    transform: scale(0.6);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .score-layout {
    grid-template-columns: 1fr;
  }

  .score-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
