:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-muted: #bfdbfe;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  --sidebar-width: 260px;
  --left-sidebar-width: 240px;
  --right-sidebar-width: 260px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.container {
  width: min(1200px, 94vw);
  margin-inline: auto;
}

.container-wide {
  width: min(1440px, 96vw);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.85rem 0;
}

.header-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.header-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-img {
  height: 32px;
  width: auto;
}

/* Workspace layout */
.workspace-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 0 3.5rem;
}

.workspace-layout-tool {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--right-sidebar-width);
}

.workspace-main {
  min-width: 0;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
  padding: 1.5rem 0 3.5rem;
}

.article-main {
  min-width: 0;
  max-width: 760px;
}

.page-single {
  padding: 1.5rem 0 3.5rem;
}

/* Sidebar */
.site-sidebar {
  position: sticky;
  top: 4.75rem;
  align-self: start;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 6rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-footer-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-subtle);
}

.sidebar-footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* App shell: main content left, tool browser right */
.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem 0 3rem;
}

.app-shell-article {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.app-main {
  min-width: 0;
}

.app-main-article {
  max-width: 780px;
}

.app-nav-panel {
  position: sticky;
  top: 5.5rem;
  align-self: start;
}

.app-nav-panel .left-sidebar-inner {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  max-height: calc(100vh - 7rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
}

.nav-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.nav-panel-head strong {
  font-size: 0.85rem;
}

.nav-panel-head span {
  font-size: 0.75rem;
  color: var(--muted);
}

.page-single {
  padding: 1.5rem 0 3rem;
}

/* Category topbar */
.category-topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.category-topbar-inner {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.65rem 0;
  scrollbar-width: thin;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.category-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.category-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.category-pill.active .category-pill-icon {
  color: #fff;
}

.category-pill-icon {
  display: flex;
  color: var(--accent);
}

.category-pill-icon svg {
  width: 14px;
  height: 14px;
}

/* Legacy aliases */
.catalog-layout,
.catalog-center,
.left-sidebar {
  /* kept for compatibility */
}

.catalog-layout {
  display: grid;
  grid-template-columns: var(--left-sidebar-width) 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem 0 3rem;
}

.catalog-layout.has-catalog-sidebar {
  grid-template-columns: var(--left-sidebar-width) 1fr var(--right-sidebar-width);
}

.catalog-layout.has-article-sidebar {
  grid-template-columns: var(--left-sidebar-width) minmax(0, 1fr) 280px;
}

.catalog-center {
  min-width: 0;
}

.left-sidebar {
  position: sticky;
  top: 4.5rem;
  align-self: start;
}

.left-sidebar-inner {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  max-height: calc(100vh - 6rem);
  overflow: hidden;
}

.sidebar-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

/* Accordion nav tree */
.nav-tree-list,
.nav-tree-panel {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-tree-toggle,
.nav-tree-tool,
.nav-tree-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}

.nav-tree-tool,
.nav-tree-link {
  font-weight: 500;
  color: var(--muted);
  padding-left: 0.5rem;
}

.nav-tree-link {
  padding-left: 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.nav-tree-toggle:hover,
.nav-tree-tool:hover,
.nav-tree-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
  text-decoration: none;
}

.nav-tree-toggle.active,
.nav-tree-tool.active,
.nav-tree-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-tree-level-1 .sidebar-cat-icon svg {
  width: 16px;
  height: 16px;
}

.nav-tree-level-2-list {
  padding-left: 0.35rem;
}

.nav-tree-level-2 {
  padding-left: 0.75rem;
  font-size: 0.82rem;
}

.nav-tree-level-3-list {
  margin-left: 1.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.nav-tree-level-3-list li {
  margin: 0.1rem 0;
}

.nav-tree-chevron::before {
  content: "›";
  margin-left: auto;
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.15s;
}

.nav-tree-item.is-open > .nav-tree-toggle .nav-tree-chevron::before {
  transform: rotate(90deg);
}

.nav-tree-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.category-section-icon svg {
  width: 20px;
  height: 20px;
}

.category-section-head h2 {
  margin: 0 0 0.15rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.category-section-head .muted {
  margin: 0;
  font-size: 0.9rem;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.75rem;
  background: var(--bg-subtle);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sidebar-search:hover {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
  color: var(--text);
}

.sidebar-search svg {
  width: 16px;
  height: 16px;
  color: currentColor;
  flex-shrink: 0;
}

.sidebar-search-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
  color: inherit;
}

.sidebar-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  min-width: 0;
  color: var(--text);
}

.sidebar-search input:focus {
  outline: none;
}

.search-kbd {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  background: var(--bg-card);
  flex-shrink: 0;
}

/* Global tool search dialog */
.tool-search-dialog {
  border: none;
  padding: 0;
  margin: auto;
  width: min(560px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  background: transparent;
  color: var(--text);
}

.tool-search-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.tool-search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 2rem));
}

.tool-search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.tool-search-form svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.tool-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  min-width: 0;
}

.tool-search-form input:focus {
  outline: none;
}

.tool-search-status {
  margin: 0;
  padding: 0.55rem 1rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-search-results {
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.75rem;
  min-height: 120px;
}

.tool-search-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}

.tool-search-item:hover,
.tool-search-item.is-active {
  background: var(--accent-soft);
  text-decoration: none;
}

.tool-search-item-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.tool-search-item.is-active .tool-search-item-title {
  color: var(--accent);
}

.tool-search-item-meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: capitalize;
}

.tool-search-empty {
  margin: 0;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

body.search-open {
  overflow: hidden;
}

.catalog-main {
  min-width: 0;
}

.catalog-hero {
  margin-bottom: 2rem;
}

.catalog-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.catalog-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 62ch;
}

.catalog-section {
  margin-bottom: 2.5rem;
}

.catalog-section .section-head h2 {
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
}

.category-block {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.category-block:first-of-type {
  border-top: none;
}

.category-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.category-section-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
}

.tool-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tool-list-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 72px;
}

.tool-list-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
  text-decoration: none;
}

.tool-list-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
}

.tool-list-icon svg {
  width: 18px;
  height: 18px;
}

.tool-list-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.tool-list-body strong {
  font-size: 0.92rem;
  line-height: 1.3;
}

.tool-list-body span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.view-all-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.pagination-link:hover {
  text-decoration: underline;
}

.pagination-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.sponsor-card {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.sponsor-card:last-of-type {
  border-bottom: none;
}

.sponsor-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.sponsor-card p {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.sponsor-card a {
  font-size: 0.8rem;
  font-weight: 600;
}

.sponsor-note {
  margin: 0.75rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
}

.feedback-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  background: #111827;
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.feedback-float:hover {
  background: #1f2937;
  color: #fff;
  text-decoration: none;
}

.feedback-float svg {
  width: 18px;
  height: 18px;
}

/* Page layout with sidebar */
.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
  padding-bottom: 3rem;
}

.main-column {
  min-width: 0;
}

/* Right sidebar */
.right-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.sidebar-heading {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.25rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
}

.sidebar-cat-link:hover,
.sidebar-cat-link.active {
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
}

.sidebar-cat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-cat-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-cat-label {
  flex: 1;
}

.sidebar-cat-chevron {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-tools-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-muted) 100%);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -8px 16px rgba(255, 255, 255, 0.9);
}

.sidebar-tools-badge:hover {
  text-decoration: none;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.sidebar-tools-badge svg {
  width: 18px;
  height: 18px;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--bg-card);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.share-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.share-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-newsletter-text {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.newsletter-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem;
  margin-bottom: 0.65rem;
  background: var(--bg-card);
}

.newsletter-input-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.newsletter-input-wrap input {
  flex: 1;
  border: none;
  padding: 0.65rem 0;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.newsletter-input-wrap input:focus {
  outline: none;
}

.newsletter-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.newsletter-btn:hover {
  background: #1f2937;
}

.feedback-btn {
  display: none;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}

.hero-inner {
  text-align: center;
  max-width: 720px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 1rem;
  line-height: 1.2;
  color: var(--text);
}

.hero-lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.hero-search {
  display: flex;
  gap: 0.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.hero-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg-card);
}

.hero-search input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.hero-search button,
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn.primary,
.hero-search button {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover,
.hero-search button:hover {
  background: var(--accent-hover);
}

.btn:not(.primary) {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.page-header {
  padding: 1.5rem 0 0.5rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 0.75rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.tool-card,
.category-card {
  display: block;
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.tool-card:hover,
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  text-decoration: none;
}

.tool-card h3,
.category-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.tool-card p,
.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.cat-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Content boxes */
.content-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.content-box h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.content-box h2:not(:first-child) {
  margin-top: 1.25rem;
}

.content-box p {
  margin: 0 0 0.85rem;
}

.content-box p:last-child {
  margin-bottom: 0;
}

.content-box ul,
.content-box ol {
  margin: 0;
  padding-left: 1.25rem;
}

.content-box li {
  margin-bottom: 0.4rem;
}

.lead-box .lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
}

/* Tool page */
.tool-page {
  padding-bottom: 1rem;
}

.tool-header {
  padding: 0.5rem 0 1.25rem;
}

.tool-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.75rem;
}

.tool-header .lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 65ch;
}

.tool-breadcrumbs {
  font-size: 0.85rem;
}

.tool-breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tool-breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--muted);
}

.tool-breadcrumbs a {
  color: var(--muted);
}

.tool-workspace {
  margin-bottom: 1.5rem;
}

.tool-workspace-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tool-upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.tool-dropzone {
  border: 2px dashed #93c5fd;
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tool-dropzone:hover,
.tool-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-icon svg {
  width: 22px;
  height: 22px;
}

.dropzone-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 1rem;
}

.dropzone-sub,
.dropzone-hint,
.tool-upload-note,
.tool-file-stats {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.tool-upload-note {
  margin-top: 1rem;
}

.tool-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.tool-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.tool-control select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  min-width: 200px;
}

.tool-file-stats {
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

.tool-preview-list {
  margin-top: 1rem;
  min-height: 48px;
}

.tool-empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-file-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tool-file-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  font-size: 0.88rem;
}

.tool-remove-file {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.tool-result-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
}

.tool-calculator-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.tool-panel label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.tool-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 160px;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.tool-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* SSL Certificate Health Checker — single-column layout */
.tool-ssl-health-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  max-width: 100%;
}

.tool-ssl-health-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.tool-ssl-health-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 72ch;
}

.tool-ssl-health-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.tool-ssl-health-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-upload:hover {
  background: var(--bg-subtle);
}

.btn-upload svg {
  width: 16px;
  height: 16px;
}

.tool-ssl-health-textarea {
  width: 100%;
  min-height: 280px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}

.tool-ssl-health-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-ssl-health-results {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tool-ssl-health-results.is-ready {
  border-color: #86efac;
}

.tool-ssl-health-results.is-warning {
  border-color: #fcd34d;
}

.tool-ssl-health-results.is-expired {
  border-color: #fca5a5;
}

.ssl-health-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-subtle);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

.ssl-health-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.is-ready .ssl-health-badge {
  background: #dcfce7;
  color: #166534;
}

.is-warning .ssl-health-badge {
  background: #fef9c3;
  color: #854d0e;
}

.is-expired .ssl-health-badge {
  background: #fee2e2;
  color: #991b1b;
}

.ssl-health-output {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-card);
  color: var(--text);
  max-height: 420px;
  overflow: auto;
}

.tool-ssl-health-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-ssl-validate,
.btn-ssl-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ssl-validate {
  background: #6b7280;
  color: #fff;
  border: none;
}

.btn-ssl-validate:hover {
  background: #4b5563;
}

.btn-ssl-clear {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ssl-clear:hover {
  background: var(--bg-subtle);
}

.btn-ssl-validate svg,
.btn-ssl-clear svg {
  width: 17px;
  height: 17px;
}

/* Password Strength Checker */
.pw-strength-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.pw-strength-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.pw-strength-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.pw-strength-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

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

.pw-strength-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

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

.pw-strength-input {
  width: 100%;
  padding: 0.7rem 2.75rem 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  box-sizing: border-box;
}

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

.pw-strength-toggle {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}

.pw-strength-toggle:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.pw-strength-toggle svg {
  width: 18px;
  height: 18px;
}

.pw-strength-privacy {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.pw-strength-report-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pw-strength-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.pw-strength-report-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.pw-strength-report-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-report-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.btn-report-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-report-action:not(:disabled):hover {
  background: var(--bg-subtle);
}

.btn-report-action svg {
  width: 14px;
  height: 14px;
}

.pw-strength-report-body {
  flex: 1;
  margin: 0;
  min-height: 200px;
  padding: 1rem;
  background: var(--bg-subtle);
  border: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.pw-strength-report-body:not(:empty) {
  color: var(--text);
}

.pw-strength-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.btn-pw-analyze {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-pw-analyze:hover {
  background: #1f2937;
}

.btn-pw-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-pw-clear:hover {
  background: var(--bg-subtle);
}

.btn-pw-analyze svg,
.btn-pw-clear svg {
  width: 17px;
  height: 17px;
}

/* Image target-size compressor (compress-to-5mb, etc.) */
.img-target-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.img-target-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.img-target-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.img-target-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.img-target-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.img-target-config {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 200px);
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 1rem;
}

.img-target-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.img-target-select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.img-target-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.img-target-size-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.img-target-size-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.img-target-size-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.img-target-size-bytes {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.img-target-counter {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.img-target-dropzone {
  margin-top: 0;
}

.img-target-drop-icon {
  background: var(--accent-soft);
}

.img-target-preview {
  margin-top: 1rem;
}

/* BMP to PCX converter */
.img-convert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.img-convert-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.img-convert-icon {
  width: 28px;
  height: 28px;
  color: var(--text);
  flex-shrink: 0;
}

.img-convert-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.img-convert-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.img-convert-status {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.25rem;
}

.img-convert-status.is-busy {
  color: var(--accent);
}

.img-convert-status.is-error {
  color: #c0392b;
}

.img-convert-dropzone {
  margin-top: 0;
}

.img-convert-drop-icon {
  background: var(--accent-soft);
}

.img-convert-preview {
  display: none;
}

.img-target-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-img-compress {
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-img-compress:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-img-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-img-clear {
  padding: 0.7rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-img-clear:hover {
  background: var(--bg-subtle);
}

/* FLAC compressor */
.flac-compress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.flac-compress-title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.flac-compress-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.flac-compress-dropzone {
  margin-bottom: 0;
}

.flac-compress-drop-icon {
  background: var(--accent-soft);
}

.flac-file-name {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.flac-compress-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-flac-compress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-flac-compress:hover:not(:disabled) {
  background: #374151;
}

.btn-flac-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-flac-compress svg {
  width: 17px;
  height: 17px;
}

.btn-flac-clear {
  padding: 0.7rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-flac-clear:hover {
  background: var(--bg-subtle);
}

.flac-compress-note {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 72ch;
}

.flac-compress-note code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--bg-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Meta Tag Generator */
.meta-tag-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.meta-tag-section {
  margin-bottom: 1.75rem;
}

.meta-tag-section-title {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-tag-field {
  margin-bottom: 1rem;
}

.meta-tag-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-tag-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.meta-tag-field-head label {
  margin: 0;
}

.meta-tag-counter {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.meta-tag-counter.is-over {
  color: #b45309;
  font-weight: 700;
}

.meta-tag-input,
.meta-tag-textarea,
.meta-tag-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}

.meta-tag-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.meta-tag-input:focus,
.meta-tag-textarea:focus,
.meta-tag-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.meta-tag-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.meta-tag-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.meta-tag-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-mtg-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mtg-generate:hover {
  background: #1f2937;
}

.btn-mtg-generate svg {
  width: 17px;
  height: 17px;
}

.btn-mtg-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mtg-clear:hover {
  background: var(--bg-subtle);
}

.btn-mtg-clear svg {
  width: 17px;
  height: 17px;
}

.meta-tag-output-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.meta-tag-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.meta-tag-output-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.meta-tag-output {
  margin: 0;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-card);
  color: var(--text);
  max-height: 360px;
  overflow: auto;
}

.tool-copy {
  max-width: none;
}

.img-preview-box {
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
}

.img-preview-img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.tool-preview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.tool-preview-pane h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tool-controls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.tool-control input[type="range"] {
  width: 140px;
  vertical-align: middle;
}

.crypto-pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.crypto-jwt-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.crypto-input-full {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
}

.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.pdf-page-thumb {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.pdf-page-thumb img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.tool-privacy-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.tool-pdf-text-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font: inherit;
  resize: vertical;
}

.tool-color-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.tool-color-row input[type="color"] {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
}

.color-preview-swatch {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.tool-calculator-panel textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font: inherit;
  resize: vertical;
}

.tool-result-box {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.tool-analyzer-stats {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.tool-timer-display {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0 1rem;
  color: var(--accent);
}

.tool-tts-panel select {
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font: inherit;
}

@media (max-width: 768px) {
  .tool-preview-split,
  .crypto-jwt-panels {
    grid-template-columns: 1fr;
  }
}

/* Generator tools */
.tool-generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.gen-controls {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gen-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gen-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.gen-row select,
.gen-row input[type="number"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg-card);
}

.gen-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.gen-checks-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-right: 0.25rem;
}

.gen-checks label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.gen-results {
  margin-top: 0.5rem;
}

.gen-table {
  font-size: 0.85rem;
}

.gen-output {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: var(--bg-subtle);
}

.gen-password-display {
  font-family: ui-monospace, monospace;
  font-size: 1.25rem;
  padding: 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  text-align: center;
  word-break: break-all;
}

.gen-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.tool-loading {
  color: var(--muted);
  margin: 0;
}

/* Prose / articles */
.prose {
  max-width: none;
  padding-bottom: 1rem;
}

.prose header {
  margin-bottom: 1rem;
}

.prose h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.prose .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}

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

/* Blog */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.blog-card h2 {
  margin: 0.35rem 0;
  font-size: 1.25rem;
}

.blog-card time {
  color: var(--muted);
  font-size: 0.85rem;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
  padding: 2.75rem 0 2rem;
}

.footer-marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  content-visibility: auto;
  contain-intrinsic-size: auto 48px;
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marquee 60s linear infinite;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.marquee-item-badge {
  padding: 0.4rem 0.75rem;
  background: #ffffff;
  border-color: var(--border);
}

.marquee-item-badge:hover {
  background: #ffffff;
  border-color: var(--accent);
}

.marquee-logo {
  display: block;
  width: auto;
  min-width: 20px;
  max-width: 120px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.marquee-logo-favicon {
  width: 20px;
  max-width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.marquee-item-badge .marquee-logo {
  opacity: 0.92;
}

.marquee-item-badge:hover .marquee-logo {
  opacity: 1;
}

.marquee-item:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 32ch;
}

.footer-links h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-links a {
  color: var(--text);
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 1200px) {
  .catalog-layout.has-catalog-sidebar {
    grid-template-columns: var(--left-sidebar-width) 1fr;
  }

  .catalog-layout.has-catalog-sidebar .right-sidebar {
    display: none;
  }

  .catalog-layout.has-article-sidebar {
    grid-template-columns: var(--left-sidebar-width) 1fr;
  }

  .catalog-layout.has-article-sidebar .article-sidebar {
    display: none;
  }
}

@media (max-width: 1024px) {
  .catalog-layout,
  .catalog-layout.has-catalog-sidebar,
  .catalog-layout.has-article-sidebar {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    position: static;
  }

  .tool-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-with-sidebar {
    grid-template-columns: 1fr;
  }

  .right-sidebar {
    position: static;
    order: 2;
  }
}

@media (max-width: 768px) {
  .header-nav {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .tool-list-grid {
    grid-template-columns: 1fr;
  }

  .tool-workspace-split {
    grid-template-columns: 1fr;
  }

  .tool-ssl-health-card {
    padding: 1.1rem 1rem;
  }

  .tool-ssl-health-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-ssl-validate,
  .btn-ssl-clear {
    justify-content: center;
    width: 100%;
  }

  .pw-strength-grid {
    grid-template-columns: 1fr;
  }

  .pw-strength-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-pw-clear {
    justify-content: center;
  }

  .img-target-config {
    grid-template-columns: 1fr;
  }

  .img-target-size-box {
    padding: 0.65rem;
  }

  .img-target-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-img-compress,
  .btn-img-clear {
    width: 100%;
    text-align: center;
  }

  .meta-tag-row {
    grid-template-columns: 1fr;
  }

  .meta-tag-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-mtg-generate,
  .btn-mtg-clear {
    justify-content: center;
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-search {
    flex-direction: column;
  }

  .feedback-float {
    right: 1rem;
    bottom: 1rem;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }
}

/* Guides index */
.guides-index {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.guides-index-header {
  margin-bottom: 2rem;
}

.guides-index-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
}

.breadcrumbs-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}

.breadcrumbs-inline a {
  color: var(--muted);
  text-decoration: none;
}

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

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

.guide-category-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-card);
}

.guide-category-head {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.guide-category-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.guide-category-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.guide-category-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.guide-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.guide-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.guide-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.guide-card-arrow {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.guide-card p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.guide-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--muted);
  border: 1px solid var(--border);
}

.guide-header {
  margin-bottom: 1.5rem;
}

/* Article layout + sidebar */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  align-items: start;
  padding-bottom: 3rem;
}

.article-main {
  min-width: 0;
}

.article-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-sidebar-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.article-sidebar-heading svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.article-sidebar-heading.muted-heading {
  color: var(--muted);
}

.article-sidebar-heading.muted-heading svg {
  display: none;
}

.article-toc-box {
  padding-bottom: 0.5rem;
}

.article-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.article-toc-list li {
  margin: 0;
}

.article-toc-link {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
}

.article-toc-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.article-toc-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.article-meta-list {
  margin: 0;
}

.article-meta-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: 0.88rem;
}

.article-meta-list dt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.article-meta-list dt svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.article-meta-list dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.article-updated {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.comparison-table th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.guide-content h3 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

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

  .article-sidebar {
    display: block;
    position: static;
    order: 2;
  }
}

/* Blog index */
.blog-index {
  min-width: 0;
}

.blog-index-header {
  margin-bottom: 1.75rem;
}

.blog-index-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
}

.blog-featured {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-subtle) 55%, #fff 100%);
  border: 1px solid var(--accent-muted);
  border-radius: 14px;
  padding: 1.65rem 1.85rem;
  margin-bottom: 2rem;
}

.blog-featured-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.blog-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.blog-badge-featured {
  background: var(--accent);
  color: #fff;
}

.blog-badge-cat {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.blog-featured h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.25;
}

.blog-featured h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-featured h2 a:hover {
  color: var(--accent);
}

.blog-featured > p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 52rem;
}

.blog-featured-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.blog-featured-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.blog-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.blog-filter-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.blog-filter-tab:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.blog-filter-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  min-width: min(100%, 220px);
}

.blog-search svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.blog-search input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.88rem;
  width: 100%;
  background: transparent;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.blog-grid-card {
  border: 1px solid #e8edf3;
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.blog-grid-card:hover {
  border-color: var(--accent-muted);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.blog-grid-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.75rem;
}

.blog-grid-cat {
  color: var(--accent);
  font-weight: 600;
}

.blog-grid-card time {
  color: var(--muted);
  white-space: nowrap;
}

.blog-grid-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.blog-grid-card h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-grid-card h2 a:hover {
  color: var(--accent);
}

.blog-grid-card > p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.blog-grid-card-bottom {
  margin-top: auto;
}

.blog-grid-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.blog-tag {
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent-muted);
}

.blog-read-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.blog-read-link:hover {
  text-decoration: underline;
}

.blog-read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.blog-read-time svg {
  width: 14px;
  height: 14px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 2rem;
  padding-top: 0.5rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination-btn:hover:not(.is-disabled):not(.is-active) {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pagination-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination-btn.is-disabled {
  color: #cbd5e1;
  border-color: #e2e8f0;
  cursor: default;
}

.pagination-ellipsis {
  padding: 0 0.25rem;
  color: var(--muted);
  font-weight: 600;
}

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

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

  .blog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-search {
    width: 100%;
  }
}

/* Article page header */
.article-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-page-header h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.article-subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 48rem;
}

.article-header-meta {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.article-header-dot {
  margin: 0 0.35rem;
}

/* Article body content */
.article-body .content-box {
  margin-bottom: 1.75rem;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
  padding-top: 0.25rem;
}

.article-body h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

.article-body p,
.article-body li {
  line-height: 1.7;
  color: #374151;
}

.article-body ul,
.article-body ol {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.article-body .lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #4b5563;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.article-table th,
.article-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
  text-align: left;
}

.article-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: #111827;
}

.article-table tr:nth-child(even) td {
  background: #fafbfc;
}

.formula-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
}

.formula-box p {
  margin: 0;
  font-weight: 600;
  color: #0c4a6e;
}

.lead-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.15rem;
  border-radius: 0 10px 10px 0;
}

/* Contact page */
.contact-page {
  min-width: 0;
  max-width: 960px;
}

.contact-header {
  margin-bottom: 1.75rem;
}

.contact-header h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin: 0 0 0.65rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: start;
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.contact-info-card h2,
.contact-info-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
}

.contact-info-muted {
  background: var(--bg-subtle);
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.contact-details li {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.contact-details li:first-child {
  border-top: none;
  padding-top: 0;
}

.contact-details svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.contact-details strong {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.contact-form {
  padding: 1.35rem;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label,
.form-field legend {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.form-field legend {
  margin-bottom: 0.65rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.req { color: #ef4444; }
.optional { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.8rem; }

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn svg { width: 18px; height: 18px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: #111827; color: #fff; }
.btn-dark:hover { background: #1f2937; }

.form-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.form-alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

/* Feedback modal */
body.modal-open { overflow: hidden; }

.feedback-modal[hidden] { display: none; }

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.feedback-modal-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  padding: 1.35rem 1.5rem 1.5rem;
}

.feedback-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.feedback-modal-title-wrap {
  display: flex;
  gap: 0.75rem;
}

.feedback-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-modal-icon svg {
  width: 20px;
  height: 20px;
}

.feedback-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.feedback-modal-header p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.feedback-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.category-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.category-pill {
  cursor: pointer;
}

.category-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-pill span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b5563;
}

.category-pill span svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.category-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.input-with-icon input {
  padding-left: 2.35rem;
}

.feedback-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.feedback-hint kbd {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
}

/* Placeholder Email Generator */
.email-gen-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.email-gen-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.email-gen-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.email-gen-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.email-gen-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.email-gen-config {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.email-gen-field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.email-gen-select,
.email-gen-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.email-gen-select:focus,
.email-gen-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.email-gen-custom-wrap {
  margin-bottom: 1rem;
}

.email-gen-custom-wrap label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.email-gen-summary {
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.88rem;
  line-height: 1.5;
}

.email-gen-summary strong {
  font-weight: 600;
}

.email-gen-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-peg-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-peg-generate:hover {
  background: #1f2937;
}

.btn-peg-generate svg {
  width: 17px;
  height: 17px;
}

.btn-peg-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-peg-clear:hover {
  background: var(--bg-subtle);
}

.btn-peg-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.email-gen-output-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.email-gen-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.email-gen-output-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.email-gen-output {
  display: block;
  width: 100%;
  min-height: 10rem;
  padding: 0.85rem 1rem;
  border: none;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
}

/* VLOOKUP / XLOOKUP Formula Builder */
.vlookup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.vlookup-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.vlookup-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.vlookup-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.vlookup-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.vlookup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.vlookup-tab {
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.vlookup-tab.is-active {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--border);
}

.vlookup-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.vlookup-syntax-bar {
  padding: 0.7rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  overflow-x: auto;
}

.vlookup-syntax-bar .syn-fn {
  color: var(--muted);
}

.vlookup-syntax-bar .syn-blue {
  color: #2563eb;
}

.vlookup-syntax-bar .syn-green {
  color: #16a34a;
}

.vlookup-syntax-bar .syn-muted {
  color: var(--muted);
}

.vlookup-fields {
  padding: 0.25rem 0;
}

.vlookup-field {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.vlookup-field:last-child {
  border-bottom: none;
}

.vlookup-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vlookup-label-wrap label {
  font-weight: 600;
  font-size: 0.88rem;
}

.vlookup-info {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}

.vlookup-input,
.vlookup-select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.vlookup-input:focus,
.vlookup-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.vlookup-field-check .vlookup-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.vlookup-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-vlookup-build {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-vlookup-build:hover {
  background: #1f2937;
}

.btn-vlookup-build svg {
  width: 17px;
  height: 17px;
}

.btn-vlookup-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-vlookup-clear:hover {
  background: var(--bg-subtle);
}

.btn-vlookup-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.vlookup-output-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.vlookup-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.vlookup-output-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.vlookup-formula {
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.vlookup-explain-title {
  margin: 0;
  padding: 0.65rem 1rem 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--bg-card);
}

.vlookup-explain {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg-card);
}

/* XML to YAML converter */
.xml-yaml-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.xml-yaml-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.xml-yaml-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.xml-yaml-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.xml-yaml-panel {
  min-width: 0;
}

.xml-yaml-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.xml-yaml-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.xml-yaml-output-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.xml-yaml-textarea {
  width: 100%;
  min-height: 22rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
}

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

.xml-yaml-output::placeholder {
  color: var(--muted);
}

.xml-yaml-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-xml-convert {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-xml-convert:hover {
  background: #374151;
}

.btn-xml-convert svg {
  width: 17px;
  height: 17px;
}

.btn-xml-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-xml-clear:hover {
  background: var(--bg-subtle);
}

.btn-xml-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

/* JSON to Go Struct */
.jtg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.jtg-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.jtg-braces {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.jtg-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.jtg-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.jtg-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.jtg-field label,
.jtg-input-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.jtg-input,
.jtg-select,
.jtg-textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.jtg-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  min-height: 16rem;
  resize: vertical;
}

.jtg-input:focus,
.jtg-select:focus,
.jtg-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.jtg-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.btn-jtg-convert {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-jtg-convert:hover {
  background: #374151;
}

.btn-jtg-convert svg {
  width: 17px;
  height: 17px;
}

.btn-jtg-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-jtg-clear:hover {
  background: var(--bg-subtle);
}

.btn-jtg-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.jtg-output-wrap {
  margin-bottom: 1.25rem;
}

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

.jtg-tips {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.jtg-tips p {
  margin: 0 0 0.5rem;
}

.jtg-tips ul {
  margin: 0;
  padding-left: 1.2rem;
}

.jtg-tips code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

/* Roman Numeral Converter */
.roman-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.roman-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.roman-tab {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.roman-tab.is-active {
  border-color: #111827;
  box-shadow: inset 0 0 0 1px #111827;
}

.roman-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.roman-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem 1rem;
  min-width: 0;
}

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

.roman-panel-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.roman-panel-actions,
.roman-output-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-roman-clear {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-roman-clear:hover {
  background: #fef2f2;
}

.btn-roman-clear svg {
  color: #dc2626;
}

.roman-textarea {
  width: 100%;
  min-height: 16rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
}

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

.roman-output::placeholder {
  color: var(--muted);
  text-align: center;
}

.roman-status {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.roman-converted-count {
  color: #16a34a;
  font-weight: 600;
}

.roman-output-actions {
  margin-top: 0.75rem;
}

/* Subnet Mask Cheat Generator */
.subnet-cheat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.subnet-cheat-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.subnet-cheat-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.subnet-cheat-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.subnet-cheat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.subnet-cheat-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.subnet-cheat-output-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subnet-cheat-textarea {
  width: 100%;
  min-height: 16rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
}

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

.subnet-cheat-output::placeholder {
  color: var(--muted);
}

.subnet-cheat-config {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.subnet-cheat-field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.subnet-cheat-select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}

.subnet-cheat-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-subnet-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-subnet-generate:hover {
  background: #374151;
}

.btn-subnet-generate svg {
  width: 17px;
  height: 17px;
}

.btn-subnet-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-subnet-clear:hover {
  background: var(--bg-subtle);
}

.btn-subnet-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

/* Empty Line Remover */
.elr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.elr-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.elr-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.elr-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.elr-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.elr-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.elr-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem 1rem;
  min-width: 0;
}

.elr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.elr-panel-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.elr-panel-actions,
.elr-output-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-elr-clear {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-elr-clear:hover {
  background: #fef2f2;
}

.btn-elr-clear svg {
  color: #dc2626;
}

.elr-textarea {
  width: 100%;
  min-height: 14rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
}

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

.elr-output::placeholder {
  color: var(--muted);
}

.elr-counter {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.elr-output-actions {
  margin-top: 0.75rem;
}

.elr-options {
  margin-bottom: 1.25rem;
}

.elr-options-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.elr-options-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.elr-options-subtitle {
  margin: 0 0 0.6rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.elr-mode-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.elr-mode-card,
.elr-extra-card {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.elr-mode-card input,
.elr-extra-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.elr-mode-card.is-active,
.elr-extra-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.elr-mode-name,
.elr-extra-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.elr-mode-desc,
.elr-extra-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.elr-extra-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.elr-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.elr-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  text-align: center;
  background: var(--bg-subtle);
}

.elr-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.elr-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.elr-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.elr-info svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--accent);
}

@media (max-width: 768px) {
  .subnet-cheat-split,
  .subnet-cheat-config,
  .elr-split,
  .elr-mode-cards,
  .elr-extra-cards,
  .elr-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .jtg-config {
    grid-template-columns: 1fr;
  }

  .roman-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .xml-yaml-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .vlookup-field {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

@media (max-width: 768px) {
  .email-gen-config {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .category-pills {
    grid-template-columns: 1fr;
  }
}

/* PWA Cache Budget Calculator */
.pwa-cache-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.pwa-cache-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.pwa-cache-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.pwa-cache-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.pwa-cache-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.pwa-cache-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pwa-cache-budget-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.pwa-cache-budget-input {
  width: 72px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.pwa-cache-url-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

.pwa-url-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.pwa-url-header {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.pwa-url-row {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  align-items: center;
}

.pwa-url-input,
.pwa-size-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.pwa-url-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.pwa-url-remove:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.pwa-add-url {
  display: block;
  margin: 0.65rem 0.75rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.pwa-cache-hint {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.pwa-cache-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-pwa-calculate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #60a5fa;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-pwa-calculate:hover {
  background: #3b82f6;
}

.btn-pwa-calculate svg {
  width: 17px;
  height: 17px;
}

.btn-pwa-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-pwa-reset:hover {
  background: var(--bg-subtle);
}

.btn-pwa-reset svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.pwa-cache-report {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.pwa-report-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.pwa-report-summary p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.pwa-over-budget {
  color: #dc2626;
  font-weight: 600;
}

.pwa-under-budget {
  color: #16a34a;
  font-weight: 600;
}

.pwa-report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.pwa-report-table th,
.pwa-report-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.pwa-report-table th {
  background: var(--bg-card);
}

.pwa-recommend h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.pwa-recommend ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
}

.pwa-report-error {
  margin: 0;
  color: #dc2626;
}

/* Color Picker & Converter */
.cpc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.cpc-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.cpc-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.cpc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.cpc-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.cpc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.cpc-sv {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  display: block;
}

.cpc-hue {
  width: 100%;
  max-width: 320px;
  margin: 0.65rem 0;
  height: 14px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  outline: none;
}

.cpc-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  background: transparent;
  cursor: pointer;
}

.cpc-preview-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cpc-preview {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cpc-preview-controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.cpc-preview-controls label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cpc-hex-input {
  width: 100%;
  max-width: 140px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
}

.cpc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cpc-preset {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}

.cpc-preset:hover {
  transform: scale(1.08);
}

.cpc-input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cpc-group-label {
  font-weight: 600;
  font-size: 0.82rem;
  min-width: 48px;
}

.cpc-input-group label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cpc-input-group input {
  width: 56px;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.cpc-formats,
.cpc-contrast {
  margin-top: 1.25rem;
}

.cpc-formats h3,
.cpc-contrast h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

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

.cpc-formats-head h3 {
  margin: 0;
}

.cpc-format-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cpc-format-row {
  display: grid;
  grid-template-columns: 64px 1fr 36px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.cpc-format-row:first-child {
  border-top: none;
}

.cpc-format-name {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
}

.cpc-format-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  word-break: break-all;
}

.cpc-format-copy {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.cpc-format-copy:hover {
  color: var(--accent);
}

.cpc-contrast-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cpc-contrast-card {
  position: relative;
  min-height: 100px;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.cpc-on-white {
  background: #fff;
  border: 1px solid var(--border);
}

.cpc-on-black {
  background: #000;
}

.cpc-contrast-label {
  font-size: 0.95rem;
}

.cpc-contrast-value {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.25rem;
}

.cpc-on-black .cpc-contrast-value {
  color: #9ca3af;
}

.cpc-contrast-badge {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: #22c55e;
  color: #fff;
  border-radius: 999px;
}

/* Random Paragraph Filler */
.rpf-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rpf-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.rpf-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.rpf-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.rpf-section-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

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

.rpf-preset {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}

.rpf-preset:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.rpf-config-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.rpf-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.rpf-input,
.rpf-select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
}

.rpf-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.rpf-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.rpf-check-muted {
  color: var(--muted);
}

.rpf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-rpf-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-rpf-generate:hover {
  background: #111827;
}

.btn-rpf-generate svg {
  width: 17px;
  height: 17px;
}

.btn-rpf-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-rpf-secondary:hover {
  background: var(--bg-subtle);
}

.btn-rpf-secondary svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.btn-rpf-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: transparent;
  color: #dc2626;
  border: none;
  cursor: pointer;
}

.btn-rpf-clear:hover {
  background: #fef2f2;
  border-radius: var(--radius-sm);
}

.btn-rpf-clear svg {
  width: 17px;
  height: 17px;
}

.rpf-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.rpf-output-head label {
  font-weight: 600;
  font-size: 0.9rem;
}

.rpf-output {
  width: 100%;
  min-height: 200px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}

.rpf-output-meta {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .pwa-url-header,
  .pwa-url-row {
    grid-template-columns: 1fr;
  }

  .cpc-workspace,
  .cpc-contrast-cards,
  .rpf-config-row {
    grid-template-columns: 1fr;
  }

  .pwa-cache-url-count {
    margin-left: 0;
    width: 100%;
  }
}

/* Gradient Background Library */
.gbl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.gbl-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.gbl-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.gbl-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.gbl-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.gbl-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.gbl-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.gbl-search {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.gbl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.gbl-filter {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.gbl-filter:hover {
  background: var(--bg-subtle);
}

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

.gbl-count {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.gbl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.gbl-card-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
}

.gbl-swatch {
  height: 88px;
}

.gbl-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
}

.gbl-card-meta {
  min-width: 0;
}

.gbl-card-name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gbl-card-css {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gbl-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
}

.gbl-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gbl-copy-btn svg {
  width: 13px;
  height: 13px;
}

.gbl-error {
  color: #dc2626;
  font-size: 0.9rem;
}

/* Batch Audio Compressor */
.bac-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.bac-title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.bac-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.bac-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  vertical-align: middle;
}

.bac-dropzone {
  margin-bottom: 0;
}

.bac-drop-icon {
  background: var(--accent-soft);
}

.bac-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.bac-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
}

.bac-file-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.bac-actions {
  margin-top: 1.25rem;
}

.btn-bac-compress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-bac-compress:hover:not(:disabled) {
  background: #374151;
}

.btn-bac-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-bac-compress svg {
  width: 17px;
  height: 17px;
}

.bac-note {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 72ch;
}

/* Image Mosaic Pixelate Tool */
.imp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.imp-title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.imp-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.imp-dropzone {
  margin-bottom: 1.25rem;
}

.imp-drop-icon {
  background: var(--accent-soft);
}

.imp-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.imp-field {
  display: block;
  margin-bottom: 0.85rem;
}

.imp-field > span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.imp-field select,
.imp-num {
  width: 100%;
  max-width: 220px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
}

.imp-field input[type="range"] {
  width: 100%;
  max-width: 280px;
  display: block;
  margin: 0.35rem 0;
}

.imp-field-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.imp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-imp-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-imp-apply:hover:not(:disabled) {
  background: #374151;
}

.btn-imp-apply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-imp-apply svg {
  width: 17px;
  height: 17px;
}

.btn-imp-download,
.btn-imp-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-imp-download:hover:not(:disabled),
.btn-imp-clear:hover {
  background: var(--bg-subtle);
}

.btn-imp-download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-imp-download svg,
.btn-imp-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.imp-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.imp-preview-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.imp-preview-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.imp-preview-head svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.imp-preview-box {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: #fff;
}

.imp-preview-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.imp-preview-img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

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

  .imp-config,
  .imp-previews {
    grid-template-columns: 1fr;
  }
}

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

/* Compress Audio to 10 MB */
.cat10-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.cat10-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.cat10-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.cat10-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.cat10-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.cat10-dropzone {
  margin-bottom: 0.75rem;
}

.cat10-drop-icon {
  background: var(--accent-soft);
}

.cat10-file-name {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.cat10-target {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
}

.cat10-target-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cat10-target-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cat10-target-text strong {
  font-size: 0.92rem;
}

.cat10-target-text span {
  font-size: 0.8rem;
  color: var(--muted);
}

.cat10-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-cat10-compress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #60a5fa;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-cat10-compress:hover:not(:disabled) {
  background: #3b82f6;
}

.btn-cat10-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-cat10-compress svg {
  width: 17px;
  height: 17px;
}

.btn-cat10-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-cat10-reset:hover {
  background: var(--bg-subtle);
}

.btn-cat10-reset svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.cat10-log-wrap {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.cat10-log-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.cat10-log {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
}

.cat10-log-row {
  line-height: 1.45;
}

.cat10-log-info {
  color: var(--muted);
}

.cat10-log-ok {
  color: #16a34a;
}

.cat10-log-fail {
  color: var(--muted);
}

.cat10-log-warn {
  color: #d97706;
}

/* Newline and Line Ending Fixer */
.nle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.nle-title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.nle-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.nle-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.nle-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--bg-card);
}

.nle-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.nle-panel-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.nle-output-actions {
  display: flex;
  gap: 0.4rem;
}

.nle-textarea {
  width: 100%;
  min-height: 280px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
  background: var(--bg-card);
}

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

.nle-output::placeholder {
  color: var(--muted);
  font-style: italic;
}

.nle-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-nle-format {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-nle-format:hover {
  background: #374151;
}

.btn-nle-format svg {
  width: 17px;
  height: 17px;
}

.btn-nle-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-nle-clear:hover {
  background: var(--bg-subtle);
}

.btn-nle-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .nle-split {
    grid-template-columns: 1fr;
  }
}

/* MKV Compressor */
.mkv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.mkv-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.mkv-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.mkv-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.mkv-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.mkv-dropzone {
  margin-bottom: 0.75rem;
}

.mkv-drop-icon {
  background: var(--accent-soft);
}

.mkv-file-name {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.mkv-config {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.mkv-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.mkv-field {
  display: block;
}

.mkv-field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.mkv-field select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
}

.mkv-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.mkv-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.mkv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-mkv-compress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #60a5fa;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mkv-compress:hover:not(:disabled) {
  background: #3b82f6;
}

.btn-mkv-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-mkv-compress svg {
  width: 17px;
  height: 17px;
}

.btn-mkv-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mkv-reset:hover {
  background: var(--bg-subtle);
}

.btn-mkv-reset svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.mkv-status {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.25rem;
}

.mkv-status.is-busy {
  color: var(--accent);
}

.mkv-status.is-ok {
  color: #16a34a;
}

.mkv-status.is-error {
  color: #dc2626;
}

.mkv-progress-wrap {
  margin-top: 0.75rem;
}

.mkv-progress-bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.mkv-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.mkv-progress-text {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Mobile Image Compressor */
.mic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.mic-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.mic-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.mic-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.mic-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.mic-dropzone {
  margin-bottom: 0.75rem;
}

.mic-drop-icon {
  background: var(--accent-soft);
}

.mic-file-name {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.mic-platforms {
  margin-bottom: 1.25rem;
}

.mic-platforms-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mic-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.mic-platform {
  display: block;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mic-platform:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.mic-platform.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mic-platform-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.mic-platform.is-active .mic-platform-name {
  color: var(--accent);
}

.mic-platform-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.mic-custom-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.mic-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.mic-field input {
  width: 140px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 400;
}

.mic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-mic-compress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #60a5fa;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mic-compress:hover:not(:disabled) {
  background: #3b82f6;
}

.btn-mic-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-mic-compress svg {
  width: 17px;
  height: 17px;
}

.btn-mic-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-mic-reset:hover {
  background: var(--bg-subtle);
}

.btn-mic-reset svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.mic-status {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.25rem;
}

.mic-status.is-busy {
  color: var(--accent);
}

.mic-status.is-ok {
  color: #16a34a;
}

.mic-status.is-warn {
  color: #d97706;
}

.mic-status.is-error {
  color: #dc2626;
}

@media (max-width: 768px) {
  .mkv-config-grid,
  .mic-platform-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .mic-platform-grid {
    grid-template-columns: 1fr;
  }
}

/* Barcode Generator */
.bcg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.bcg-section {
  margin-bottom: 1.25rem;
}

.bcg-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.bcg-format-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.bcg-format-card {
  display: block;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
}

.bcg-format-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bcg-format-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.bcg-format-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.bcg-format-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.bcg-data-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.bcg-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.bcg-custom-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.bcg-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.bcg-field input[type="number"],
.bcg-field input[type="color"] {
  width: 100%;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 400;
}

.bcg-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding-bottom: 0.35rem;
}

.bcg-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.btn-bcg-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-bcg-generate:hover {
  background: #111827;
}

.btn-bcg-generate svg {
  width: 17px;
  height: 17px;
}

.btn-bcg-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-bcg-reset:hover {
  background: var(--bg-subtle);
}

.btn-bcg-reset svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.bcg-output-wrap {
  text-align: center;
}

.bcg-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 0.75rem;
  overflow: auto;
}

.bcg-preview svg,
.bcg-preview canvas {
  max-width: 100%;
  height: auto;
}

.bcg-download-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

/* Base64 Encoder/Decoder */
.b64-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.b64-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.b64-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.b64-field > span {
  font-size: 0.85rem;
  font-weight: 600;
}

.b64-field select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
}

.b64-input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.b64-textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
  margin-bottom: 1rem;
}

.b64-output {
  margin-top: -0.5rem;
}

.b64-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-b64-run {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-b64-run:hover {
  background: #374151;
}

.btn-b64-run svg {
  width: 17px;
  height: 17px;
}

.btn-b64-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-b64-clear:hover {
  background: var(--bg-subtle);
}

.btn-b64-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.b64-info {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.b64-info ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.b64-info li {
  margin-bottom: 0.35rem;
}

/* URL Encoder/Decoder */
.ued-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.ued-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.ued-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.ued-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.ued-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ued-field > span {
  font-size: 0.85rem;
  font-weight: 600;
}

.ued-field select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
}

.ued-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ued-panel-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ued-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ued-output-actions {
  display: flex;
  gap: 0.4rem;
}

.ued-textarea {
  width: 100%;
  min-height: 260px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
}

.ued-output::placeholder {
  color: var(--muted);
  font-style: italic;
}

.ued-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-ued-run {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ued-run:hover {
  background: #374151;
}

.btn-ued-run svg {
  width: 17px;
  height: 17px;
}

.btn-ued-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ued-clear:hover {
  background: var(--bg-subtle);
}

.btn-ued-clear svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.ued-examples {
  margin-bottom: 1.25rem;
}

.ued-examples-title,
.ued-reference-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.ued-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.ued-example {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.35rem;
  align-items: start;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  font-size: 0.75rem;
}

.ued-example:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.ued-ex-in,
.ued-ex-out {
  font-family: var(--font-mono, monospace);
  word-break: break-all;
}

.ued-ex-arrow {
  color: var(--muted);
}

.ued-table-wrap {
  overflow-x: auto;
}

.ued-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ued-table th,
.ued-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
}

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

@media (max-width: 768px) {
  .bcg-format-cards,
  .bcg-custom-grid,
  .b64-config,
  .ued-config,
  .ued-split,
  .ued-examples-grid,
  .pvd-split,
  .cbl-split,
  .cbl-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Spreadsheet Formula Explainer */
.sfe-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.sfe-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sfe-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.sfe-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.sfe-desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.sfe-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.sfe-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 1rem;
}

.sfe-examples-wrap {
  margin-bottom: 1rem;
}

.sfe-examples-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 0.5rem;
}

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

.sfe-example {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.sfe-example:hover {
  color: var(--text);
  border-color: var(--text);
}

.sfe-error {
  color: #dc2626;
  font-size: 0.875rem;
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
}

.sfe-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn-sfe-run,
.btn-sfe-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sfe-run svg,
.btn-sfe-clear svg {
  width: 1rem;
  height: 1rem;
}

.btn-sfe-run {
  background: var(--text);
  color: var(--bg);
  min-width: 180px;
  justify-content: center;
}

.btn-sfe-clear {
  background: var(--bg);
  color: var(--muted);
  border-color: var(--border);
}

.sfe-result {
  margin-top: 0.5rem;
}

.sfe-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.02);
  margin-bottom: 1rem;
}

.sfe-summary-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.sfe-summary-formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  word-break: break-all;
}

.sfe-summary-text {
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

.sfe-warnings {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.sfe-warning-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: #92400e;
}

.sfe-warning-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.sfe-steps-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.sfe-step {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.sfe-step-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.sfe-cat {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-transform: lowercase;
}

.sfe-cat-logical { color: #2563eb; background: #eff6ff; border-color: #bfdbfe; }
.sfe-cat-lookup { color: #9333ea; background: #faf5ff; border-color: #e9d5ff; }
.sfe-cat-math { color: #16a34a; background: #f0fdf4; border-color: #bbf7d0; }
.sfe-cat-text { color: #ea580c; background: #fff7ed; border-color: #fed7aa; }
.sfe-cat-date { color: #0d9488; background: #f0fdfa; border-color: #99f6e4; }
.sfe-cat-statistical { color: #4f46e5; background: #eef2ff; border-color: #c7d2fe; }
.sfe-cat-financial { color: #ca8a04; background: #fefce8; border-color: #fef08a; }
.sfe-cat-info { color: #6b7280; background: #f9fafb; border-color: #e5e7eb; }
.sfe-cat-array { color: #db2777; background: #fdf2f8; border-color: #fbcfe8; }
.sfe-cat-ref { color: #0891b2; background: #ecfeff; border-color: #a5f3fc; }

.sfe-step-expr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  background: var(--bg-subtle, #f3f4f6);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  word-break: break-all;
}

.sfe-step-text {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.45;
}

/* Passive Voice Detector */
.pvd-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.pvd-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pvd-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #f59e0b;
  flex-shrink: 0;
}

.pvd-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.pvd-desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

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

.pvd-stat {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.02);
}

.pvd-stat-amber {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.pvd-stat-amber .pvd-stat-label,
.pvd-stat-amber .pvd-stat-value {
  color: #d97706;
}

.pvd-stat-green {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.pvd-stat-green .pvd-stat-label,
.pvd-stat-green .pvd-stat-value {
  color: #16a34a;
}

.pvd-stat-red {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.pvd-stat-red .pvd-stat-label,
.pvd-stat-red .pvd-stat-value {
  color: #dc2626;
}

.pvd-stat-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.pvd-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pvd-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pvd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.pvd-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.pvd-panel-actions {
  display: flex;
  gap: 0.35rem;
}

.pvd-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.pvd-mini-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.pvd-mini-btn:hover {
  background: var(--bg-subtle, #f3f4f6);
  color: var(--text);
}

.pvd-mini-btn-danger {
  color: #dc2626;
}

.pvd-mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pvd-textarea {
  width: 100%;
  min-height: 280px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.55;
  resize: vertical;
  background: var(--bg);
}

.pvd-output {
  min-height: 280px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.875rem;
  line-height: 1.55;
}

.pvd-output-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.pvd-mark {
  background: #fde68a;
  color: #78350f;
  border-radius: 2px;
  padding: 0 2px;
}

.pvd-mark-sm {
  font-size: 0.75rem;
  font-weight: 600;
}

.pvd-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pvd-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
}

.pvd-copy-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.pvd-copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pvd-no-passive {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 500;
}

.pvd-output-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.pvd-list-section {
  margin-top: 1.25rem;
}

.pvd-list-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.pvd-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 16rem;
  overflow-y: auto;
}

.pvd-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
}

.pvd-list-item-open {
  border-color: #fbbf24;
  background: #fffbeb;
}

.pvd-list-sent {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.pvd-list-tip {
  font-size: 0.75rem;
  color: #92400e;
  margin: 0.35rem 0 0;
}

.pvd-list-num {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* CSV to Bullet List */
.cbl-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cbl-settings {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.015);
}

.cbl-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cbl-csv-options {
  display: contents;
}

.cbl-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cbl-field span {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cbl-field select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--bg);
}

.cbl-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 1rem;
}

.cbl-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.cbl-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.cbl-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--card-bg, #fff);
}

.cbl-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.cbl-panel-title {
  font-size: 1rem;
  font-weight: 600;
}

.cbl-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cbl-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.cbl-mini-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.cbl-mini-btn-danger {
  color: #dc2626;
}

.cbl-mini-btn:disabled,
.cbl-copy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cbl-textarea {
  width: 100%;
  min-height: 280px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.55;
  resize: vertical;
  background: var(--bg);
}

.cbl-output {
  min-height: 280px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.cbl-placeholder {
  color: var(--muted);
}

.cbl-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.cbl-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
}

.cbl-copy-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.cbl-chars {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

/* Add Text to Image / Meme Maker */
.ati-card,
.abp-card,
.aip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.ati-dropzone,
.abp-dropzone,
.aip-dropzone {
  margin-bottom: 0.75rem;
}

.ati-drop-icon,
.abp-drop-icon,
.aip-drop-icon {
  background: var(--accent-soft);
}

.ati-file-name,
.abp-file-name,
.aip-file-name {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.abp-format-hint,
.aip-format-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.ati-captions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.ati-caption-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--bg-subtle);
}

.ati-caption-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.ati-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.ati-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.ati-field input[type="text"],
.ati-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.ati-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.ati-color-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ati-color-wrap input[type="color"] {
  width: 2.5rem;
  height: 2.25rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-card);
}

.ati-hex {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.ati-slider-field {
  display: block;
  margin-bottom: 0.75rem;
}

.ati-slider-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.ati-slider-label strong {
  color: var(--text);
  font-weight: 700;
}

.ati-slider-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.ati-align-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.ati-align-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.ati-align-btns {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ati-align-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.ati-align-btn + .ati-align-btn {
  border-left: 1px solid var(--border);
}

.ati-align-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.ati-caps-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: auto;
  cursor: pointer;
}

.ati-output-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.ati-quality-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.ati-quality-field.is-disabled input[type="range"] {
  opacity: 0.45;
}

.ati-actions,
.abp-actions,
.aip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.btn-ati-generate,
.btn-abp-primary,
.btn-aip-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #4b5563;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ati-generate:hover:not(:disabled),
.btn-abp-primary:hover:not(:disabled),
.btn-aip-primary:hover:not(:disabled) {
  background: #374151;
}

.btn-ati-generate:disabled,
.btn-abp-primary:disabled,
.btn-aip-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ati-generate svg,
.btn-abp-primary svg,
.btn-aip-primary svg {
  width: 17px;
  height: 17px;
}

.btn-ati-secondary,
.btn-abp-secondary,
.btn-aip-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ati-secondary:hover:not(:disabled),
.btn-abp-secondary:hover,
.btn-aip-secondary:hover {
  background: var(--bg-subtle);
}

.btn-ati-secondary svg {
  width: 17px;
  height: 17px;
}

.ati-preview-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ati-preview-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ati-preview {
  display: flex;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow: auto;
}

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

.ati-status,
.aip-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ati-status.is-success,
.aip-status.is-success {
  color: #059669;
}

.ati-status.is-error,
.aip-status.is-error {
  color: #dc2626;
}

.abp-page-count {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.abp-footer {
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

.aip-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.aip-fields {
  margin: 1rem 0;
}

.aip-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.aip-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.aip-field input,
.aip-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.aip-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 768px) {
  .ati-captions,
  .ati-output-row,
  .ati-row-2,
  .aip-row-2 {
    grid-template-columns: 1fr;
  }

  .ati-caps-check {
    margin-left: 0;
    width: 100%;
  }
}

/* GZIP Compression Ratio Checker */
.gcrc-card,
.cssc-card,
.gzpc-card,
.ttfw-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.gcrc-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.gcrc-presets-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.25rem;
}

.gcrc-preset-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.gcrc-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gcrc-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.gcrc-input-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.gcrc-upload-btn,
.cssc-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.gcrc-upload-btn svg,
.cssc-upload-btn svg {
  width: 1rem;
  height: 1rem;
}

.gcrc-textarea,
.cssc-textarea {
  width: 100%;
  min-height: 280px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.gcrc-stats {
  margin-top: 1.25rem;
}

.gcrc-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gcrc-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: var(--bg-subtle);
}

.gcrc-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.gcrc-stat strong {
  font-size: 1rem;
}

.gcrc-bandwidth {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--bg-subtle);
}

.gcrc-bandwidth-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.gcrc-bandwidth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gcrc-bandwidth-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.gcrc-info,
.cssc-info {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  color: #1e40af;
}

.gcrc-info svg,
.cssc-info svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.gcrc-info strong,
.cssc-info strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.gcrc-info p,
.cssc-info p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* CSS Compressor */
.cssc-heading,
.gzpc-heading,
.ttfw-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.cssc-icon,
.gzpc-icon,
.ttfw-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.cssc-title,
.gzpc-title,
.ttfw-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.cssc-desc,
.gzpc-desc,
.ttfw-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 72ch;
}

.cssc-options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cssc-options-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.cssc-options-toggle svg {
  width: 1rem;
  height: 1rem;
}

.cssc-options-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.cssc-reset-defaults {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.cssc-options-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.cssc-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.cssc-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cssc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cssc-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.cssc-panel-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.cssc-output {
  background: var(--bg-subtle);
}

.cssc-actions,
.gzpc-actions,
.ttfw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-cssc-compress,
.btn-gzpc-compress,
.btn-ttfw-convert {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-cssc-compress svg,
.btn-gzpc-compress svg,
.btn-ttfw-convert svg {
  width: 1.1rem;
  height: 1.1rem;
}

.btn-cssc-compress:hover,
.btn-gzpc-compress:hover:not(:disabled),
.btn-ttfw-convert:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-cssc-clear,
.btn-gzpc-clear,
.btn-gzpc-download,
.btn-ttfw-clear {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-gzpc-compress:disabled,
.btn-gzpc-download:disabled,
.btn-ttfw-convert:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* GZIP File Compressor */
.gzpc-dropzone,
.ttfw-dropzone {
  margin-bottom: 1rem;
}

.gzpc-drop-icon,
.ttfw-drop-icon {
  background: var(--accent-soft);
}

.gzpc-file-name {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.gzpc-stats {
  margin-bottom: 1rem;
}

.gzpc-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gzpc-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: var(--bg-subtle);
}

.gzpc-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

/* TTF to WOFF */
.ttfw-file-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.ttfw-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.ttfw-file-remove {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.78rem;
  cursor: pointer;
}

.ttfw-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .gcrc-stat-grid,
  .gcrc-bandwidth-grid,
  .gzpc-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cssc-split {
    grid-template-columns: 1fr;
  }
}

/* Country Info Lookup */
.cil-card,
.ptb-card,
.abd-card,
.tsd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.cil-title,
.ptb-title,
.tsd-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.cil-desc,
.ptb-desc,
.tsd-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 80ch;
}

.cil-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.cil-search-wrap,
.ptb-search-wrap {
  position: relative;
}

.cil-search-icon,
.ptb-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
}

.cil-search,
.ptb-search {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.cil-region {
  min-width: 10rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.cil-count {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.cil-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.cil-card-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
}

.cil-card-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.cil-flag {
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.cil-card-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.cil-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cil-footer,
.ptb-footer {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.cil-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cil-modal[hidden] {
  display: none;
}

.cil-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cil-modal-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: 85vh;
  overflow: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.cil-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.cil-modal-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cil-modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.cil-modal-flag {
  border-radius: 3px;
  object-fit: cover;
}

.cil-modal-details,
.ptb-detail-list {
  display: grid;
  gap: 0.65rem;
}

.cil-detail-row,
.ptb-detail-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.75rem;
  font-size: 0.88rem;
}

.cil-detail-row dt,
.ptb-detail-row dt {
  font-weight: 600;
  color: var(--muted);
}

.cil-detail-row dd,
.ptb-detail-row dd {
  margin: 0;
}

/* Periodic Table */
.ptb-heading,
.tsd-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.ptb-icon,
.tsd-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.ptb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ptb-legend-btn {
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.ptb-legend-btn.is-active {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.ptb-cat-alkali { background: #fecaca; color: #7f1d1d; }
.ptb-cat-alkaline-earth { background: #fed7aa; color: #7c2d12; }
.ptb-cat-transition { background: #fef08a; color: #713f12; }
.ptb-cat-post-transition { background: #bbf7d0; color: #14532d; }
.ptb-cat-metalloid { background: #99f6e4; color: #134e4a; }
.ptb-cat-nonmetal { background: #bfdbfe; color: #1e3a8a; }
.ptb-cat-noble-gas { background: #ddd6fe; color: #4c1d95; }
.ptb-cat-lanthanide { background: #fbcfe8; color: #831843; }
.ptb-cat-actinide { background: #fecdd3; color: #881337; }
.ptb-cat-unknown { background: #e5e7eb; color: #374151; }

.ptb-grid-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.ptb-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(44px, 1fr));
  grid-template-rows: repeat(9, minmax(52px, auto));
  gap: 3px;
  min-width: 820px;
}

.ptb-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  cursor: pointer;
  min-height: 52px;
}

.ptb-tile:hover {
  filter: brightness(0.95);
  outline: 2px solid var(--accent);
}

.ptb-num {
  align-self: flex-start;
  font-size: 0.55rem;
  opacity: 0.75;
}

.ptb-sym {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.ptb-name {
  font-size: 0.48rem;
  text-align: center;
  line-height: 1.1;
  opacity: 0.85;
}

.ptb-detail {
  position: relative;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.ptb-detail[hidden] {
  display: none;
}

.ptb-detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--muted);
}

.ptb-detail-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

/* Add Bleed */
.abd-dropzone {
  margin-bottom: 0.75rem;
}

.abd-drop-icon {
  background: var(--accent-soft);
}

.abd-file-name {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.abd-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.abd-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.abd-input,
.abd-select {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.abd-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.abd-preview-wrap {
  margin-bottom: 1.25rem;
}

.abd-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  margin-top: 0.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.abd-preview-bleed {
  position: absolute;
  width: 120px;
  height: 90px;
  border: 2px dashed var(--muted);
  border-radius: 2px;
}

.abd-preview-page {
  position: relative;
  width: 80px;
  height: 60px;
  background: #fff;
  border: 2px solid var(--text);
  border-radius: 1px;
  z-index: 1;
}

.abd-preview-legend {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.abd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.btn-abd-process {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: #374151;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-abd-process:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-abd-process svg {
  width: 1rem;
  height: 1rem;
}

.btn-abd-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-abd-clear svg {
  width: 1rem;
  height: 1rem;
}

.abd-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Text Statistics Dashboard */
.tsd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tsd-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: var(--bg-subtle);
}

.tsd-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.tsd-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.tsd-stat-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.tsd-top-words {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
}

.tsd-top-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.tsd-top-table-wrap {
  overflow: auto;
  max-height: 16rem;
}

.tsd-top-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tsd-top-table th,
.tsd-top-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tsd-top-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tsd-textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
}

.tsd-privacy {
  margin: 0.5rem 0 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tsd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-tsd-export,
.btn-tsd-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-tsd-export {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-tsd-export:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-tsd-export svg,
.btn-tsd-clear svg {
  width: 1rem;
  height: 1rem;
}

.btn-tsd-clear {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.tsd-status {
  font-size: 0.82rem;
  color: var(--muted);
}

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

  .tsd-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cil-search-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cil-grid,
  .tsd-stats-grid {
    grid-template-columns: 1fr;
  }

  .cil-detail-row,
  .ptb-detail-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* Header login button */
.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}

.header-login-btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.header-login-btn svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

.header-auth {
  margin-left: 0.5rem;
}

.auth-menu {
  position: relative;
}

.auth-menu-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.auth-menu-trigger::-webkit-details-marker {
  display: none;
}

.auth-avatar,
.auth-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-menu-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 200px;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

.auth-menu-email {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}

.auth-menu-logout {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.auth-menu-logout:hover {
  background: var(--accent-soft);
  border-color: var(--accent-muted);
  color: var(--accent);
}

/* Auth pages */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 3.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.12), transparent 55%),
    linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 48%, var(--bg-subtle) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem 1.85rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-google-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-muted);
}

.auth-google-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-google-slot {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

.auth-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.auth-field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.auth-field input::placeholder {
  color: var(--muted);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--bg);
}

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-submit:hover {
  background: var(--accent-hover);
}

.auth-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.88rem;
}

.auth-footer {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.auth-footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-login-btn,
  .header-auth {
    margin-left: auto;
  }

  .auth-menu-name {
    display: none;
  }

  .auth-card {
    padding: 1.75rem 1.25rem 1.5rem;
  }
}

/* —— Homepage sections (AsliTools layout, AboveTool teal/blue palette) —— */
.home-asli {
  --home-accent: #2563eb;
  --home-accent-hover: #1d4ed8;
  --home-accent-soft: #eff6ff;
  --home-ink: #0f172a;
  --home-muted: #64748b;
  --home-grid: rgba(37, 99, 235, 0.07);
}

.home-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: center;
  margin: 0 0 1.75rem;
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(var(--home-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--home-grid) 1px, transparent 1px),
    linear-gradient(145deg, #f8fbff 0%, #eef4ff 55%, #ffffff 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--home-accent-soft);
  color: var(--home-accent);
  font-size: 0.84rem;
  font-weight: 600;
}

.home-hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--home-accent);
}

.home-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 3.6vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--home-ink);
  max-width: 14ch;
}

.home-hero-brand {
  display: inline;
  color: var(--home-accent);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(37, 99, 235, 0.35);
}

.home-hero-lead {
  margin: 0 0 0.9rem;
  color: var(--home-muted);
  font-size: 1.02rem;
  max-width: 42ch;
  line-height: 1.55;
}

.home-hero-stats {
  margin: 0;
  color: var(--home-ink);
  font-size: 0.95rem;
}

.home-hero-stats strong {
  color: var(--home-accent);
  font-weight: 800;
}

.home-converter-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  padding: 1.25rem 1.2rem 1.1rem;
}

.home-conv-step {
  margin-bottom: 1.1rem;
}

.home-conv-step:last-child {
  margin-bottom: 0;
}

.home-conv-step h2 {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--home-ink);
}

.home-conv-step h2 span {
  color: var(--home-muted);
  font-weight: 600;
}

.home-dropzone {
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 1.15rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

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

.home-dropzone-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.home-add-files {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--home-accent) !important;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
}

.home-add-files:hover {
  background: var(--home-accent-hover) !important;
}

.home-add-files svg {
  width: 16px;
  height: 16px;
}

.home-cloud-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 0;
}

.home-cloud-btn:hover {
  border-color: var(--home-accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.home-cloud-btn svg {
  width: 22px;
  height: 22px;
}

.home-dropzone-hint {
  margin: 0 0 0.75rem;
  color: var(--home-muted);
  font-size: 0.88rem;
}

.home-format-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.home-format-pills span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--home-muted);
}

.home-file-name {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--home-accent);
  word-break: break-all;
}

.home-format-select-wrap {
  position: relative;
}

.home-format-select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 0.9rem center no-repeat;
  padding: 0.8rem 2.2rem 0.8rem 0.9rem;
  font: inherit;
  color: var(--home-muted);
}

.home-format-select:not(:disabled) {
  color: var(--home-ink);
  background-color: #fff;
}

.home-convert-now {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-convert-now:not(:disabled) {
  background: var(--home-accent);
  color: #fff;
}

.home-convert-now:not(:disabled):hover {
  background: var(--home-accent-hover);
}

.home-convert-now:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.home-convert-arrow {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
}

.home-convert-now:disabled .home-convert-arrow {
  background: rgba(30, 64, 175, 0.12);
}

.home-terms-note {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--home-muted);
}

.home-terms-note a {
  color: var(--home-accent);
}

.home-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.home-pillar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 0.75rem;
  text-align: center;
}

.home-pillar strong {
  display: block;
  color: var(--home-accent);
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
}

.home-pillar span {
  color: var(--home-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.home-section {
  margin-bottom: 3rem;
}

.home-section-head h2,
.home-carousel-head h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--home-ink);
}

.home-section-head p,
.home-carousel-head p {
  margin: 0;
  color: var(--home-muted);
  max-width: 62ch;
}

.home-section-head-center {
  text-align: center;
  margin-bottom: 1.25rem;
}

.home-section-head-center p {
  margin-inline: auto;
}

.home-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.home-filter-tabs-center {
  justify-content: center;
}

.home-filter-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--home-ink);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.home-filter-tab:hover {
  border-color: var(--home-accent);
  color: var(--home-accent);
}

.home-filter-tab.is-active {
  background: var(--home-accent);
  border-color: var(--home-accent);
  color: #fff;
}

.home-tool-grid {
  display: grid;
  gap: 0.75rem;
}

.home-tool-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-tool-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: var(--home-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  min-height: 88px;
}

.home-tool-card[hidden] {
  display: none !important;
}

.home-tool-card:hover {
  border-color: var(--home-accent);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--home-ink);
}

.home-tool-card-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--home-accent-soft);
  color: var(--home-accent);
}

.home-tool-card-icon svg {
  width: 18px;
  height: 18px;
}

.home-tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.home-tool-card-body strong {
  font-size: 0.92rem;
}

.home-tool-card-body span {
  font-size: 0.78rem;
  color: var(--home-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-section-cta-center {
  display: flex;
  justify-content: center;
  margin-top: 1.35rem;
}

.home-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--home-accent-soft);
  color: var(--home-accent);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.home-view-all-btn:hover {
  background: #dbeafe;
  color: var(--home-accent-hover);
  text-decoration: none;
}

.home-view-all-btn svg {
  width: 16px;
  height: 16px;
}

.home-carousel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.home-carousel-nav {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.home-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--home-ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.home-carousel-btn:hover {
  border-color: var(--home-accent);
  color: var(--home-accent);
}

.home-carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.home-carousel-card {
  flex: 0 0 min(260px, 78vw);
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
}

.home-carousel-visual {
  position: relative;
  min-height: 140px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.home-carousel-tone-1 .home-carousel-visual { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.home-carousel-tone-2 .home-carousel-visual { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.home-carousel-tone-3 .home-carousel-visual { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.home-carousel-tone-4 .home-carousel-visual { background: linear-gradient(135deg, #1d4ed8, #6366f1); }
.home-carousel-tone-5 .home-carousel-visual { background: linear-gradient(135deg, #1e3a8a, #2563eb); }

.home-carousel-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.home-carousel-visual-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
}

.home-carousel-visual-icon svg {
  width: 26px;
  height: 26px;
}

.home-carousel-watermark {
  position: absolute;
  bottom: 0.55rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.68rem;
  opacity: 0.55;
  font-weight: 600;
}

.home-carousel-body {
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.home-carousel-body h3 {
  margin: 0;
  font-size: 1rem;
}

.home-carousel-body p {
  margin: 0;
  flex: 1;
  font-size: 0.84rem;
  color: var(--home-muted);
  line-height: 1.4;
}

.home-carousel-body a {
  color: var(--home-accent);
  font-weight: 700;
  text-decoration: none;
}

.home-carousel-body a:hover {
  color: var(--home-accent-hover);
  text-decoration: underline;
}

.home-why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.home-why-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.15rem;
  background: #fff;
}

.home-why-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.home-why-icon svg {
  width: 20px;
  height: 20px;
}

.home-why-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.home-why-card p {
  margin: 0;
  color: var(--home-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.home-cat-block {
  margin-bottom: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.home-cat-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.home-cat-block h3 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
}

.home-cat-title-link {
  color: inherit;
  text-decoration: none;
}

.home-cat-title-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .home-tool-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-hero-split {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
  }

  .home-hero-copy h1 {
    max-width: none;
  }

  .home-pillars,
  .home-why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-carousel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .home-pillars,
  .home-tool-grid-4,
  .home-why-grid {
    grid-template-columns: 1fr;
  }
}

/* Featured interactive tools */
.tool-workspace-featured-tool {
  max-width: 920px;
}

.ft-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.ft-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: #0f172a;
}

.ft-desc {
  margin: 0 0 1.1rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ft-subh {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.ft-grid-2,
.ft-grid-3 {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.ft-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ft-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ft-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
}

.ft-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
}

.ft-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.55rem;
}

.ft-label input,
.ft-label select,
.ft-date-row input,
.ft-card > .ft-label input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.ft-date-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ft-date-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #475569;
}

.ft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.35rem 0 1rem;
}

.ft-drop {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  border-radius: 12px;
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  color: #1e40af;
  margin-bottom: 0.75rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ft-drop:hover,
.ft-drop.is-drag {
  background: #dbeafe;
  border-color: #2563eb;
}

.ft-file-name {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #334155;
}

.ft-result {
  margin-top: 0.25rem;
  color: #1e293b;
  font-size: 0.95rem;
}

.ft-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.ft-stats > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.ft-stats strong {
  display: block;
  font-size: 1.15rem;
  color: #0f172a;
}

.ft-stats span {
  font-size: 0.78rem;
  color: #64748b;
}

.ft-ok {
  color: #166534;
}

.ft-err {
  color: #b91c1c;
}

.ft-note {
  color: #64748b;
  font-size: 0.85rem;
}

.ft-mini {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.ft-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.ft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ft-table th,
.ft-table td {
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.ft-table th {
  background: #f1f5f9;
  color: #334155;
}

.ft-seg,
.ft-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 999px;
}

.ft-seg button,
.ft-tabs button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
}

.ft-seg button.is-active,
.ft-tabs button.is-active {
  background: #2563eb;
  color: #fff;
}

.home-carousel-body h3 a {
  color: inherit;
  text-decoration: none;
}

.home-carousel-body h3 a:hover {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .ft-grid-2,
  .ft-grid-3 {
    grid-template-columns: 1fr;
  }
}

.home-cloud-status {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: #1d4ed8;
}

.home-cloud-status.is-error {
  color: #b91c1c;
}

.home-drive-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.home-drive-dialog {
  width: min(480px, 100%);
  max-height: min(70vh, 560px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-drive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.home-drive-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.home-drive-search {
  margin: 0.75rem 1rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.home-drive-list {
  overflow: auto;
  padding: 0.35rem 0.55rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-drive-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  border: 0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.home-drive-item:hover {
  background: #eff6ff;
}

.home-drive-item small {
  color: #64748b;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.home-drive-empty {
  margin: 0.5rem 1rem 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

/* Tip calculators */
.tool-workspace-tip-calculator {
  max-width: 720px;
}

.tip-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.tip-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: #0f172a;
}

.tip-desc {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.94rem;
  line-height: 1.5;
}

.tip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.tip-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #334155;
}

.tip-label input,
.tip-label select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.tip-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.tip-preset {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.tip-preset.is-active,
.tip-preset:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tip-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}

.tip-stats > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  text-align: center;
}

.tip-stats strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}

.tip-stats span {
  font-size: 0.75rem;
  color: #64748b;
}

.tip-result-note,
.tip-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

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

/* Payment calculators */
.tool-workspace-payment-calculator {
  max-width: 760px;
}

.pay-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.pay-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: #0f172a;
}

.pay-desc {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.94rem;
  line-height: 1.5;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.pay-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #334155;
}

.pay-label input,
.pay-label select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pay-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}

.pay-stats > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  text-align: center;
}

.pay-stats strong {
  display: block;
  font-size: 1.05rem;
  color: #0f172a;
}

.pay-stats span {
  font-size: 0.75rem;
  color: #64748b;
}

.pay-result-note,
.pay-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

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

/* File tools */
.tool-workspace-file-tool {
  max-width: 860px;
}

.ftool-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.45rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.ftool-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: #0f172a;
}

.ftool-desc {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.94rem;
  line-height: 1.5;
}

.ftool-drop {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  border-radius: 12px;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  color: #1e40af;
  margin-bottom: 0.75rem;
}

.ftool-drop:hover,
.ftool-drop.is-drag {
  background: #dbeafe;
  border-color: #2563eb;
}

.ftool-drop-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ftool-files {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #334155;
}

.ftool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ftool-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.75rem;
}

.ftool-label input,
.ftool-label select,
.ftool-label textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.ftool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.ftool-pre {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 28rem;
}

.ftool-note {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ftool-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ftool-emoji-grid button {
  font-size: 1.35rem;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
}

.ftool-emoji-grid button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.wtool-entry-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0 0.85rem;
}

.wtool-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.9rem;
}

.wtool-entry-row code {
  font-size: 0.82rem;
}

.wtool-entry-row .btn {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.wtool-hl-tab.is-active,
.wtool-hl-tab[aria-selected="true"] {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.ntool-rich {
  display: grid;
  gap: 0.85rem;
}

.ntool-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.ntool-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.ntool-stat-k {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.ntool-stat-v {
  font-weight: 650;
  font-size: 0.95rem;
  color: #0f172a;
  word-break: break-word;
}

.ntool-stat-v.is-ok { color: #15803d; }
.ntool-stat-v.is-bad { color: #b91c1c; }

.ntool-kv {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 0.45rem 0.75rem;
  align-items: start;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eef2f7;
}

.ntool-k {
  font-size: 0.82rem;
  color: #475569;
}

.ntool-v {
  font-size: 0.84rem;
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  word-break: break-all;
}

.ntool-legend {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.ntool-bit-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr;
  gap: 0.45rem;
  align-items: start;
}

.ntool-bit-label {
  font-size: 0.78rem;
  color: #334155;
  font-weight: 600;
  word-break: break-all;
}

.ntool-bit-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ntool-bit-group {
  display: inline-flex;
  gap: 1px;
  padding: 0.15rem;
  background: #f8fafc;
  border-radius: 6px;
}

.ntool-bit {
  display: inline-flex;
  width: 0.85rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  border-radius: 3px;
}

.ntool-bit-same {
  background: #dcfce7;
  color: #166534;
}

.ntool-bit-diff {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.ntool-map-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.ntool-map {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}

.ntool-map-link {
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

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

  .ntool-kv,
  .ntool-bit-row {
    grid-template-columns: 1fr;
  }
}


/* AI calculators */
.aic-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.25rem;
  max-width: 920px;
}
.aic-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}
.aic-desc {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
}
.aic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 0.85rem;
  margin-bottom: 0.9rem;
}
.aic-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 550;
}
.aic-label input,
.aic-label select,
.aic-label textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}
.aic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.aic-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}
.aic-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
}
.aic-stat strong {
  display: block;
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 0.15rem;
}
.aic-stat span {
  font-size: 0.78rem;
  color: #64748b;
}
.aic-result-note {
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
  color: #475569;
}
.aic-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}
.aic-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.aic-bar span {
  display: block;
  height: 100%;
  background: #0ea5e9;
}
@media (max-width: 640px) {
  .aic-grid {
    grid-template-columns: 1fr;
  }
}

/* OpenAI cost dashboard */
.oai-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 1rem 1.15rem;
  align-items: start;
}
.oai-left,
.oai-right {
  display: grid;
  gap: 0.75rem;
}
.oai-panel,
.oai-details,
.oai-table-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}
.oai-section {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.oai-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 550;
  margin-bottom: 0.65rem;
}
.oai-label:last-child { margin-bottom: 0; }
.oai-label input[type="number"],
.oai-label input[type="text"],
.oai-label select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}
.oai-label input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}
.oai-rates {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}
.oai-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #334155;
  margin-bottom: 0.4rem;
}
.oai-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.oai-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #1e293b;
  list-style: none;
}
.oai-details summary::-webkit-details-marker { display: none; }
.oai-details[open] summary { margin-bottom: 0.65rem; }
.oai-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}
.oai-hero {
  position: relative;
  border: 2px solid #3b82f6;
  border-radius: 14px;
  padding: 1rem 1.05rem 0.95rem;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 55%);
  overflow: hidden;
}
.oai-hero-kicker {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}
.oai-hero-total {
  margin: 0.2rem 0 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
  color: #2563eb;
}
.oai-hero-sub {
  margin: 0.15rem 0 0.85rem;
  color: #64748b;
  font-size: 0.9rem;
}
.oai-hero-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  border-top: 1px solid #dbeafe;
  padding-top: 0.7rem;
}
.oai-hero-split span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 700;
}
.oai-hero-split strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  color: #0f172a;
}
.oai-table-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.oai-table-head p {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}
.oai-table-head span {
  font-size: 0.72rem;
  color: #94a3b8;
}
.oai-table-scroll { overflow-x: auto; }
.oai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.oai-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid #e2e8f0;
}
.oai-table td {
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  color: #0f172a;
}
.oai-table tr.is-selected {
  background: #eff6ff;
}
.oai-model-cell strong { font-size: 0.9rem; }
.oai-mini-rates {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #94a3b8;
}
.oai-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.oai-tag-sel {
  background: #dbeafe;
  color: #1d4ed8;
}
.oai-opt {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 650;
}
.oai-opt-muted {
  background: #f1f5f9;
  color: #94a3b8;
}
.oai-disclaimer {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #eff6ff;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.45;
}
.oai-actions-inline { display: flex; gap: 0.5rem; }
@media (max-width: 900px) {
  .oai-layout { grid-template-columns: 1fr; }
  .oai-hero-split,
  .oai-grid2 { grid-template-columns: 1fr; }
}

/* Audio-video tool engine */
.av-section-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
}
.av-bitrate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}
.av-bitrate-btn {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: #334155;
}
.av-bitrate-btn strong { font-size: 0.95rem; color: #0f172a; }
.av-bitrate-btn span { font-size: 0.75rem; color: #64748b; }
.av-bitrate-btn:hover { border-color: #93c5fd; background: #f8fbff; }
.av-bitrate-btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}
.av-check-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.av-check-label input { width: auto; }
.av-ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.av-episodes { display: grid; gap: 0.75rem; }
.av-episode {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem;
  background: #f8fafc;
}
.av-episode-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}
.av-episode-top strong { font-size: 0.9rem; }
