/*
Theme Name: Pochitto Tool
Theme URI: https://pochitto-tool.site/
Author: Pochitto Team
Description: 無料で使える本格Webツール集。最高品質UI/UXのモダンツールサイトテーマ。
Version: 2.9.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pochitto-tool
*/

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--c-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
  font-size: var(--fs-sm);
  text-decoration: none;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus {
  top: 0;
}

/* ============================================================
   0. CSS RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   1. DESIGN TOKENS (Light Mode)
   ============================================================ */
:root {
  /* --- Brand Colors --- */
  --c-primary: #2563eb;
  --c-primary-light: #3b82f6;
  --c-primary-dark: #1d4ed8;
  --c-primary-50: #eff6ff;
  --c-primary-100: #dbeafe;
  --c-primary-200: #bfdbfe;
  --c-accent: #06b6d4;
  --c-accent-light: #22d3ee;

  /* --- Semantic --- */
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-error: #ef4444;

  /* --- Surface & Text --- */
  --c-bg: #f7f9fc;
  --c-bg-card: #ffffff;
  --c-bg-elevated: #ffffff;
  --c-bg-hero: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 50%, #faf5ff 100%);
  --c-bg-tool: #ffffff;
  --c-bg-result: linear-gradient(135deg, #f0f7ff 0%, #f5f3ff 100%);
  --c-bg-input: #ffffff;
  --c-border: #cbd5e1;
  --c-border-hover: #94a3b8;
  --c-border-focus: var(--c-primary);
  --c-text: #0f172a;
  --c-text-secondary: #475569;
  --c-text-muted: #94a3b8;
  --c-text-inverse: #ffffff;

  /* --- Glass Effect --- */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 20px;

  /* --- Typography --- */
  --font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.3;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;
  --lh-loose: 2.0;

  /* --- Spacing --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* --- Radius --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-tool: 0 0 0 1px rgba(37,99,235,0.06), 0 4px 16px rgba(37,99,235,0.05);
  --shadow-tool-hover: 0 0 0 1px rgba(37,99,235,0.12), 0 12px 32px rgba(37,99,235,0.10);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,0.2);
  --shadow-glow: 0 0 20px rgba(37,99,235,0.15);

  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* --- Layout --- */
  --w-max: 1200px;
  --w-content: 800px;
  --w-narrow: 640px;
  --header-h: 64px;
}

/* ============================================================
   2. DARK MODE TOKENS
   ============================================================ */
[data-theme="dark"] {
  --c-primary-50: rgba(59, 130, 246, 0.15);
  --c-primary-100: rgba(59, 130, 246, 0.22);
  --c-primary-200: rgba(59, 130, 246, 0.35);
  --c-bg: #0b1120;
  --c-bg-card: #131c31;
  --c-bg-elevated: #1a2540;
  --c-bg-hero: linear-gradient(135deg, #0b1120 0%, #131c31 50%, #1a1030 100%);
  --c-bg-tool: #131c31;
  --c-bg-result: linear-gradient(135deg, #111d35 0%, #1a1535 100%);
  --c-bg-input: #0f1829;
  --c-border: #1e3050;
  --c-border-hover: #2a4070;
  --c-text: #e8edf5;
  --c-text-secondary: #94a3b8;
  --c-text-muted: #64748b;
  --c-text-inverse: #0f172a;

  --glass-bg: rgba(19, 28, 49, 0.80);
  --glass-border: rgba(30, 48, 80, 0.6);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.3);
  --shadow-tool: 0 0 0 1px rgba(37,99,235,0.15), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-tool-hover: 0 0 0 1px rgba(37,99,235,0.3), 0 12px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(37,99,235,0.2);
  color-scheme: dark;
}

/* ============================================================
   3. BASE ELEMENTS
   ============================================================ */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-base) ease, color var(--t-base) ease;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
a:hover { color: var(--c-primary-dark); }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  color: var(--c-text);
  font-weight: var(--fw-bold);
}

::selection {
  background: var(--c-primary-200);
  color: var(--c-primary-dark);
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ============================================================
   4. CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-narrow {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ============================================================
   5. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow var(--t-base) ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
}

/* --- Logo --- */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

img.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 30%;
  object-fit: cover;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-spring);
}

.site-logo:hover img.logo-icon {
  transform: scale(1.08) rotate(-3deg);
}

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

.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  letter-spacing: -0.02em;
}

/* --- Header Nav --- */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.header-nav a {
  display: flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--t-fast) ease;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--c-primary);
  background: var(--c-primary-50);
}

/* --- Header Search --- */
.header-search {
  position: relative;
  flex-shrink: 0;
}

.header-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}

.header-search input {
  width: 200px;
  padding: var(--sp-2) 36px var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-family: var(--font-main);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  color: var(--c-text);
  transition: all var(--t-base) var(--ease-out);
}

.header-search input:focus {
  width: 280px;
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.header-search:focus-within .header-search-icon {
  color: var(--c-primary);
}

/* 入力中はアイコンを非表示 */
.header-search input:not(:placeholder-shown) ~ .header-search-icon {
  opacity: 0;
}

/* --- Theme Toggle --- */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text-secondary);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--c-primary-50);
  color: var(--c-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--t-base) var(--ease-spring);
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text);
  border-radius: var(--r-sm);
  cursor: pointer;
}

/* ============================================================
   6. HERO SECTION
   ============================================================ */
.hero {
  background: var(--c-bg-hero);
  padding: var(--sp-16) 0 var(--sp-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 15% 40%, rgba(99,102,241,0.12) 0%, transparent 40%),
              radial-gradient(circle at 85% 30%, rgba(6,182,212,0.1) 0%, transparent 40%),
              radial-gradient(circle at 50% 90%, rgba(168,85,247,0.08) 0%, transparent 35%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,0.06) 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, rgba(6,182,212,0.05) 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px;
  pointer-events: none;
}

/* --- Hero Icons Row --- */
.hero-icons {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
}

.hero-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  transition: all var(--t-base) var(--ease-spring);
}

.hero-icon-item:hover {
  background: rgba(255,255,255,0.6);
  transform: translateY(-4px) scale(1.08);
}

[data-theme="dark"] .hero-icon-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-4px) scale(1.08);
}

.hero-icon-item img {
  width: 40px;
  height: 40px;
  border-radius: 26%;
  overflow: hidden;
}

.hero-icon-item span {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
  background: var(--c-primary-50);
  border: 1px solid var(--c-primary-200);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.03em;
}

.hero h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.04em;
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: var(--fs-lg);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-8);
}

/* --- Hero Lead --- */
.hero-lead strong {
  color: var(--c-primary);
}

.hero-sub {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-top: calc(-1 * var(--sp-6));
  margin-bottom: var(--sp-8);
  letter-spacing: 0.02em;
}

/* --- Hero Search --- */
.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-md);
  font-family: var(--font-main);
  background: var(--c-bg-card);
  border: 2px solid rgba(99,102,241,0.4);
  border-radius: var(--r-xl);
  color: var(--c-text);
  box-shadow: 0 0 20px rgba(99,102,241,0.1);
  transition: all var(--t-base) var(--ease-out);
}

.hero-search input::placeholder {
  color: var(--c-text-muted);
}

.hero-search input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 24px rgba(99,102,241,0.2);
  outline: none;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
}

.hero-stat-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* ============================================================
   7. CATEGORY SECTION
   ============================================================ */
.section {
  padding: var(--sp-16) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.section-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* --- Category Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
}

.category-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-tool-hover);
  transform: translateY(-4px);
}

.category-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
  transition: transform var(--t-base) var(--ease-spring);
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26%;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}

.category-count {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ============================================================
   8. TOOL GRID
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 100%);
  opacity: 0;
  transition: opacity var(--t-base) ease;
}

.tool-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-tool-hover);
  transform: translateY(-4px);
}

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

.tool-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: none;
  border-radius: 26%;
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.tool-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26%;
}

.tool-card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}

.tool-card-desc {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
  flex-grow: 1;
}

.tool-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.tool-card-tag {
  display: inline-flex;
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-primary-50);
  color: var(--c-primary);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

/* ============================================================
   9. TOOL PAGE (Single Tool)
   ============================================================ */
.tool-page {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.tool-header {
  text-align: center;
  margin-bottom: var(--sp-10);
}

.tool-header h1 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}

.tool-description {
  font-size: var(--fs-md);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
}

/* --- Tool Card (Container) --- */
.tool-container {
  background: var(--c-bg-tool);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-tool);
  margin-bottom: var(--sp-8);
}

/* --- Tool Inputs --- */
.tool-input-group {
  margin-bottom: var(--sp-5);
}

.tool-input-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}

.tool-input-group .input-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: var(--lh-relaxed);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* --- Options Row --- */
.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.tool-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  cursor: pointer;
}

.tool-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--c-primary);
  cursor: pointer;
}

/* --- Primary Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  font-weight: var(--fw-semibold);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  line-height: 1;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

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

.btn-lg {
  width: 100%;
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-md);
  border-radius: var(--r-lg);
}

.btn-secondary {
  color: var(--c-text-secondary);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
}

.btn-secondary:hover {
  border-color: var(--c-primary-200);
  color: var(--c-primary);
  background: var(--c-primary-50);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
}

.btn-group {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* --- Result Area --- */
.tool-result {
  background: var(--c-bg-result);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-top: var(--sp-6);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
  pointer-events: none;
}

.tool-result.visible {
  opacity: 1;
  pointer-events: auto;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.result-item {
  padding: var(--sp-4);
  background: var(--c-bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}

.result-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-1);
}

.result-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.result-value.primary {
  color: var(--c-primary);
}

.result-value.accent {
  color: var(--c-accent);
}

.result-details {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}

.result-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}

.result-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

.result-detail-label {
  color: var(--c-text-secondary);
}

.result-detail-value {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* --- Chart --- */
.tool-chart {
  max-height: 320px;
  margin-top: var(--sp-5);
}

/* ============================================================
   10. ARTICLE CONTENT (SEO Text below tool)
   ============================================================ */
.article-content {
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-10);
  line-height: var(--lh-loose);
  margin-bottom: var(--sp-8);
}

.article-content h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--c-primary-100);
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.article-content p {
  margin-bottom: var(--sp-4);
  color: var(--c-text-secondary);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
}

.article-content li {
  margin-bottom: var(--sp-2);
  color: var(--c-text-secondary);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
}

.article-content th,
.article-content td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  text-align: left;
}

.article-content th {
  background: var(--c-primary);
  color: #fff;
  font-weight: var(--fw-semibold);
}

/* ============================================================
   11. FAQ ACCORDION
   ============================================================ */
.faq-section {
  margin-bottom: var(--sp-8);
}

.faq-item {
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  background: var(--c-bg-card);
  transition: border-color var(--t-fast) ease;
}

.faq-item.open {
  border-color: var(--c-primary-200);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
  gap: var(--sp-3);
}

.faq-question:hover {
  background: rgba(37,99,235,0.08);
  color: var(--c-primary);
}

[data-theme="dark"] .faq-question:hover {
  background: rgba(37,99,235,0.15);
  color: var(--c-primary-light);
}

[data-theme="dark"] .faq-item.open {
  background: var(--c-bg-elevated);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--c-text-muted);
  transition: transform var(--t-base) var(--ease-out);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--c-primary);
}

.faq-answer {
  display: none;
  padding: 0 var(--sp-5) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
}

.faq-item.open .faq-answer {
  display: block;
  animation: fadeSlideIn var(--t-base) var(--ease-out);
}

/* ============================================================
   12. RELATED TOOLS
   ============================================================ */
.related-tools {
  margin-bottom: var(--sp-8);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.related-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
}

.related-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: none;
  border-radius: 26%;
  overflow: hidden;
  flex-shrink: 0;
}

.related-card-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}

/* ============================================================
   13. BREADCRUMB
   ============================================================ */
.breadcrumb {
  padding: var(--sp-4) 0;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.breadcrumb a {
  color: var(--c-text-muted);
}

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

.breadcrumb .sep {
  margin: 0 var(--sp-2);
}

/* ============================================================
   14. FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-text);
  color: var(--c-text-muted);
  padding: var(--sp-16) 0 var(--sp-8);
}

[data-theme="dark"] .site-footer {
  background: #060a14;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  text-decoration: none;
}

.footer-logo .logo-icon {
  width: 32px;
  height: 32px;
  font-size: var(--fs-sm);
}

.footer-logo .logo-text {
  color: #ffffff;
  font-size: var(--fs-md);
}

.footer-desc {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--c-text-muted);
}

.footer-heading {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: #ffffff;
  margin-bottom: var(--sp-4);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--sp-2);
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  transition: color var(--t-fast) ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: var(--w-max);
  margin: var(--sp-10) auto 0;
  padding: var(--sp-6) var(--sp-6) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ============================================================
   15. TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-primary);
  color: #ffffff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--r-full);
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-base) var(--ease-out);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   16. ANIMATIONS
   ============================================================ */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   17. UTILITY CLASSES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--c-primary); }
.text-muted { color: var(--c-text-muted); }
.mt-4 { margin-top: var(--sp-4); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-8 { margin-bottom: var(--sp-8); }

/* ============================================================
   18. RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .header-nav { display: none !important; }
  .header-search { display: none; }
  .menu-toggle { display: flex; }

  .site-header.nav-open {
    height: auto;
    overflow: visible;
  }

  /* Mobile Nav Overlay */
  .header-nav.open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--c-bg);
    padding: var(--sp-6) var(--sp-4);
    gap: var(--sp-2);
    z-index: 999;
    animation: fadeIn var(--t-fast) ease;
    overflow-y: auto;
  }

  .header-nav.open a {
    display: block;
    font-size: var(--fs-lg);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--r-lg);
    white-space: normal;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border);
    transition: background var(--t-fast) ease;
  }

  .header-nav.open a:last-child {
    border-bottom: none;
  }

  .header-nav.open a:hover,
  .header-nav.open a:active {
    background: var(--c-bg-card);
    color: var(--c-primary);
  }

  .hero-icons {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    gap: var(--sp-3) var(--sp-4);
  }

  .hero {
    padding: var(--sp-10) 0 var(--sp-8);
  }

  .hero h1 {
    font-size: var(--fs-3xl);
  }

  .hero p {
    font-size: var(--fs-base);
  }

  .hero-stats {
    gap: var(--sp-5);
  }

  .hero-stat-number {
    font-size: var(--fs-xl);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .category-card {
    padding: var(--sp-4) var(--sp-3);
  }

  .category-icon {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .tool-container {
    padding: var(--sp-5);
    border-radius: var(--r-xl);
  }

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

  .result-details-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-content {
    padding: var(--sp-6);
    border-radius: var(--r-xl);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }

  .section {
    padding: var(--sp-10) 0;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .hero h1 {
    font-size: var(--fs-2xl);
  }

  .hero-search input {
    padding: var(--sp-3) var(--sp-4) var(--sp-3) 44px;
    font-size: var(--fs-sm);
  }

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

  .result-details-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

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

  .cc-result-big {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: var(--sp-2) !important;
  }

  .cc-result-number {
    font-size: var(--fs-4xl) !important;
  }

  .cc-result-sub {
    flex-direction: column !important;
    gap: var(--sp-1) !important;
  }

  .cc-result-sub-divider {
    display: none !important;
  }

  .cc-details-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ============================================================
   19. CHARACTER COUNT TOOL
   ============================================================ */

/* --- Result Bar (above input) --- */
.cc-result-bar {
  position: relative;
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-bottom: none;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--sp-8);
  overflow: hidden;
}

.cc-result-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 50%, #8b5cf6 100%);
}

.cc-result-bar::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.03) 0%, transparent 60%);
  pointer-events: none;
}

[data-theme="dark"] .cc-result-bar::after {
  background: linear-gradient(180deg, rgba(37,99,235,0.06) 0%, transparent 60%);
}

.cc-result-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.cc-result-big {
  display: flex;
  flex-direction: column;
}

.cc-result-number {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: var(--fw-extrabold);
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color var(--t-fast) ease;
}

.cc-result-number.primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cc-result-unit {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  margin-top: var(--sp-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cc-result-sub {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
}

.cc-result-sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.cc-result-sub strong {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  font-size: var(--fs-xl);
}

.cc-result-sub-divider {
  color: var(--c-border);
  font-size: var(--fs-lg);
}

/* --- Input Wrap --- */
.cc-input-wrap {
  position: relative;
}

.cc-input-wrap textarea {
  width: 100%;
  min-height: 300px;
  padding: var(--sp-6);
  font-size: var(--fs-md);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
  resize: vertical;
  line-height: var(--lh-relaxed);
  transition: border-color var(--t-base) ease, box-shadow var(--t-base) ease;
}

.cc-input-wrap textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 4px 20px rgba(37,99,235,0.08);
  outline: none;
}

[data-theme="dark"] .cc-input-wrap textarea:focus {
  box-shadow: 0 4px 20px rgba(37,99,235,0.15);
}

.cc-input-wrap textarea::placeholder {
  color: var(--c-text-muted);
  font-size: var(--fs-base);
}

.cc-input-actions {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  gap: var(--sp-2);
}

.cc-input-actions .btn-icon {
  width: 38px;
  height: 38px;
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  opacity: 0.6;
  transition: all var(--t-base) var(--ease-out);
  backdrop-filter: blur(8px);
}

.cc-input-actions .btn-icon:hover {
  opacity: 1;
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

/* --- Details (collapsible) --- */
.cc-details {
  margin-top: var(--sp-6);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-bg-card);
  overflow: hidden;
  transition: border-color var(--t-base) ease;
}

.cc-details[open] {
  border-color: var(--c-primary-200);
}

.cc-details summary {
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast) ease;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

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

.cc-details summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--t-base) var(--ease-out);
}

.cc-details[open] summary::before {
  transform: rotate(90deg);
}

.cc-details summary:hover {
  color: var(--c-primary);
  background: rgba(37,99,235,0.04);
}

[data-theme="dark"] .cc-details summary:hover {
  background: rgba(37,99,235,0.08);
}

.cc-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--c-border);
  border-top: 1px solid var(--c-border);
}

.cc-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--c-bg-card);
  text-align: center;
}

.cc-detail span {
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
}

.cc-detail strong {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.cc-detail strong {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--c-text);
}

@media (max-width: 768px) {
  .cc-result-bar {
    padding: var(--sp-4) var(--sp-5);
  }

  .cc-result-number {
    font-size: var(--fs-4xl);
  }

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

  .cc-input-wrap textarea {
    min-height: 220px;
  }
}

/* ============================================================
   20. AGE CALCULATOR TOOL
   ============================================================ */

.age-input-section {
  padding: var(--sp-6);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
}

.age-input-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}

.age-date-inputs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.age-date-inputs input[type="number"] {
  width: 100px;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3);
}

.age-date-inputs select {
  width: 80px;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3);
}

.age-date-sep {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  flex-shrink: 0;
}

/* --- Main Result --- */
.age-result {
  margin-top: var(--sp-6);
  animation: fadeSlideIn var(--t-base) var(--ease-out);
}

.age-main-result {
  text-align: center;
  padding: var(--sp-8);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
  position: relative;
  overflow: hidden;
}

.age-main-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 50%, #8b5cf6 100%);
}

.age-main-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--sp-2);
}

.age-number-value {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: var(--fw-extrabold);
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--c-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.age-number-unit {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text-muted);
}

.age-main-detail {
  margin-top: var(--sp-2);
  font-size: var(--fs-md);
  color: var(--c-text-secondary);
  font-weight: var(--fw-medium);
}

/* --- Info Cards Grid --- */
.age-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.age-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-3);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  text-align: center;
  transition: all var(--t-base) var(--ease-out);
}

.age-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.age-card-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.age-card-value {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

@media (max-width: 480px) {
  .age-number-value {
    font-size: 3.5rem;
  }

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

  .age-date-inputs input[type="number"] {
    width: 80px;
  }

  .age-date-inputs select {
    width: 70px;
  }
}

/* ============================================================
   21. REGEX CHECKER TOOL
   ============================================================ */

.regex-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.regex-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}

.regex-delim {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--c-text-muted);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

.regex-input-wrap input[type="text"] {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  padding: var(--sp-2) 0;
  flex: 1;
  min-width: 0;
}

.regex-input-wrap input[type="text"]:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.regex-flags {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.regex-flag {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-text-muted);
  background: transparent;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) ease;
}

.regex-flag:hover {
  border-color: var(--c-primary-200);
  color: var(--c-primary);
}

.regex-flag.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
}

.regex-error {
  display: none;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--c-error);
  background: rgba(239,68,68,0.08);
  border-radius: var(--r-sm);
}

.regex-replace-wrap {
  margin-top: var(--sp-3);
}

.regex-replace-wrap input {
  font-family: var(--font-mono);
}

.regex-test-wrap {
  position: relative;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--t-fast) ease;
}

.regex-test-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}

.regex-test-highlight,
.regex-test-input {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  padding: var(--sp-4);
  white-space: pre-wrap;
  word-wrap: break-word;
  width: 100%;
  min-height: 160px;
}

.regex-test-highlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  color: transparent;
  pointer-events: none;
  overflow: hidden;
}

.regex-test-highlight mark {
  color: transparent;
}

.regex-test-input {
  position: relative;
  background: transparent;
  color: var(--c-text);
  border: none;
  resize: vertical;
  z-index: 1;
}

.regex-test-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.regex-highlight {
  border-radius: 2px;
  padding: 0 1px;
}

.regex-match-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 300px;
  overflow-y: auto;
}

.regex-match-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  font-size: var(--fs-xs);
}

.regex-match-index {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
  min-width: 28px;
}

.regex-match-value {
  font-family: var(--font-mono);
  color: var(--c-text);
  background: rgba(37,99,235,0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

.regex-match-pos {
  color: var(--c-text-muted);
}

.regex-match-group {
  font-family: var(--font-mono);
  color: var(--c-accent);
  background: rgba(6,182,212,0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

.regex-output-pre {
  padding: var(--sp-4);
  background: var(--c-bg-input);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  color: var(--c-text);
}

.regex-replace-result {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}

.regex-presets {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
}

.regex-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.regex-preset,
.cidr-preset,
.diff-sample,
.radix-preset,
.json-sample {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  font-family: var(--font-main);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  white-space: nowrap;
}

.regex-preset:hover,
.cidr-preset:hover,
.diff-sample:hover,
.radix-preset:hover,
.json-sample:hover {
  border-color: var(--c-primary-200);
  color: var(--c-primary);
  background: var(--c-primary-50);
}

.regex-replace-toggle {
  margin-bottom: var(--sp-2);
}

@media (max-width: 768px) {
  .regex-input-wrap {
    flex-wrap: wrap;
  }

  .regex-flags {
    width: 100%;
    justify-content: flex-start;
    margin-top: var(--sp-2);
  }

  .regex-match-list {
    max-height: 200px;
  }
}

/* ============================================================
   22. CIDR CALCULATOR TOOL
   ============================================================ */

.cidr-input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.cidr-octet {
  width: 64px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3) var(--sp-2) !important;
}

.cidr-prefix-field {
  width: 52px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  padding: var(--sp-3) var(--sp-2) !important;
}

.cidr-sep {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text-muted);
  flex-shrink: 0;
  user-select: none;
}

@media (max-width: 480px) {
  .cidr-octet {
    width: 48px !important;
    font-size: var(--fs-base);
  }
  .cidr-prefix-field {
    width: 40px !important;
    font-size: var(--fs-base);
  }
  .cidr-sep {
    font-size: var(--fs-lg);
  }
}

.cidr-binary-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.cidr-binary-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}

.cidr-binary-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  min-width: 120px;
  flex-shrink: 0;
}

.cidr-binary-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text);
  letter-spacing: 0.05em;
  word-break: break-all;
}

.cidr-net-bit {
  color: var(--c-primary);
  font-weight: var(--fw-bold);
}

.cidr-host-bit {
  color: var(--c-text-muted);
}

@media (max-width: 768px) {
  .cidr-binary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-1);
  }

  .cidr-binary-label {
    min-width: auto;
  }
}

/* ============================================================
   23. DIFF TOOL
   ============================================================ */

.diff-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.diff-output {
  margin-top: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  max-height: 600px;
  overflow-y: auto;
}

.diff-inline {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.diff-line {
  display: flex;
  min-height: 24px;
  line-height: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

[data-theme="dark"] .diff-line {
  border-bottom-color: rgba(255,255,255,0.04);
}

.diff-line-num {
  min-width: 40px;
  padding: 0 var(--sp-2);
  text-align: right;
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  background: var(--c-bg);
  border-right: 1px solid var(--c-border);
  flex-shrink: 0;
  user-select: none;
}

.diff-line-text {
  padding: 0 var(--sp-3);
  white-space: pre-wrap;
  word-break: break-all;
  flex: 1;
}

.diff-equal {
  background: var(--c-bg-card);
}

.diff-added {
  background: rgba(16,185,129,0.15);
  border-left: 3px solid var(--c-success);
}

.diff-added .diff-line-num {
  background: rgba(16,185,129,0.2);
  color: var(--c-success);
  font-weight: var(--fw-bold);
}

.diff-added .diff-line-text {
  color: #065f46;
}

[data-theme="dark"] .diff-added .diff-line-text {
  color: #6ee7b7;
}

.diff-removed {
  background: rgba(239,68,68,0.15);
  border-left: 3px solid var(--c-error);
}

.diff-removed .diff-line-num {
  background: rgba(239,68,68,0.2);
  color: var(--c-error);
  font-weight: var(--fw-bold);
}

.diff-removed .diff-line-text {
  color: #991b1b;
  text-decoration: line-through;
}

[data-theme="dark"] .diff-removed .diff-line-text {
  color: #fca5a5;
}

.diff-empty {
  background: var(--c-bg);
}

.diff-empty .diff-line-num {
  background: var(--c-bg);
}

.diff-char-add {
  background: rgba(16,185,129,0.4);
  border-radius: 2px;
  padding: 1px 2px;
  font-weight: var(--fw-bold);
}

.diff-char-del {
  background: rgba(239,68,68,0.4);
  border-radius: 2px;
  padding: 1px 2px;
  text-decoration: line-through;
}

.diff-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.diff-side-col {
  overflow-x: auto;
}

.diff-side-header {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  text-align: center;
}

.diff-side-col:first-child {
  border-right: 2px solid var(--c-border);
}

/* --- Paired diff view (left=before, right=after) --- */
.diff-paired {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

.diff-pair {
  display: grid;
  grid-template-columns: 36px 1fr 36px 1fr;
  border-bottom: 1px solid var(--c-border);
}

.diff-pair-header {
  background: var(--c-bg);
  font-family: var(--font-main);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  border-bottom: 2px solid var(--c-border);
}

.diff-pair-header .diff-pair-left,
.diff-pair-header .diff-pair-right {
  padding: var(--sp-2) var(--sp-4);
  text-align: center;
}

.diff-pair-num {
  padding: var(--sp-3) var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  text-align: right;
  background: var(--c-bg);
  user-select: none;
  border-right: 1px solid var(--c-border);
}

.diff-pair-left,
.diff-pair-right {
  padding: var(--sp-3) var(--sp-4);
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 28px;
}

/* Equal rows */
.diff-pair-equal .diff-pair-left,
.diff-pair-equal .diff-pair-right {
  color: var(--c-text-muted);
  background: var(--c-bg-card);
}

/* Changed rows */
.diff-pair-old {
  background: rgba(239,68,68,0.1);
}

.diff-pair-new {
  background: rgba(16,185,129,0.1);
}

/* Empty cell (add-only or remove-only) */
.diff-pair-empty {
  background: var(--c-bg);
  opacity: 0.5;
}

.diff-pair-empty::after {
  content: '';
}

@media (max-width: 768px) {
  .diff-pair {
    grid-template-columns: 28px 1fr;
  }

  .diff-pair-left {
    border-bottom: 1px dashed var(--c-border);
  }

  .diff-pair-equal .diff-pair-right,
  .diff-pair-equal .diff-pair-num:nth-child(3) {
    display: none;
  }

  .diff-pair-header .diff-pair-right,
  .diff-pair-header .diff-pair-num:nth-child(3) {
    display: none;
  }
}

.diff-identical {
  padding: var(--sp-8);
  text-align: center;
  font-size: var(--fs-md);
  color: var(--c-success);
  font-weight: var(--fw-semibold);
}

@media (max-width: 768px) {
  .diff-input-row {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  .diff-side {
    grid-template-columns: 1fr;
  }

  .diff-side-col:first-child {
    border-right: none;
    border-bottom: 2px solid var(--c-border);
  }

  .diff-output {
    max-height: 400px;
  }
}

/* ============================================================
   24. RADIX CONVERTER TOOL
   ============================================================ */

.radix-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.radix-row {
  display: flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: background var(--t-fast) ease;
  border-bottom: 1px solid var(--c-border);
  position: relative;
}

.radix-row:last-child {
  border-bottom: none;
}

.radix-row:hover {
  background: var(--c-primary-50);
}

[data-theme="dark"] .radix-row:hover {
  background: rgba(37,99,235,0.08);
}

.radix-row:active {
  background: var(--c-primary-100);
}

.radix-row::after {
  content: 'コピー';
  position: absolute;
  right: var(--sp-5);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  opacity: 0;
  transition: opacity var(--t-fast) ease;
}

.radix-row:hover::after {
  opacity: 1;
}

.radix-row.copied::after {
  content: 'コピーしました';
  color: var(--c-success);
  opacity: 1;
}

.radix-row-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text-secondary);
  min-width: 60px;
  flex-shrink: 0;
}

.radix-row-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  word-break: break-all;
  line-height: 1.4;
  padding-left: var(--sp-4);
}

/* Color accents via left border */
.radix-row-bin { border-left: 4px solid #3b82f6; }
.radix-row-oct { border-left: 4px solid #8b5cf6; }
.radix-row-dec { border-left: 4px solid #10b981; }
.radix-row-hex { border-left: 4px solid #f59e0b; }

/* --- Bit Visualizer --- */
.radix-bits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
}

.radix-bit {
  width: 36px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all var(--t-fast) ease;
}

.radix-bit-on {
  background: var(--c-primary);
  color: #ffffff;
}

.radix-bit-off {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
}

.radix-bit-val {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1;
}

.radix-bit-pos {
  font-size: 9px;
  opacity: 0.6;
  line-height: 1;
  margin-top: 2px;
}

.radix-bit-sep {
  width: 8px;
  height: 2px;
  background: var(--c-border);
  border-radius: 1px;
}

@media (max-width: 768px) {
  .radix-row {
    padding: var(--sp-3) var(--sp-4);
  }

  .radix-row-value {
    font-size: var(--fs-md);
  }

  .radix-row::after {
    display: none;
  }

  .radix-bit {
    width: 28px;
    height: 36px;
  }

  .radix-bit-val {
    font-size: var(--fs-xs);
  }

  .radix-bit-pos {
    font-size: 8px;
  }
}

/* ============================================================
   25. BMI CALCULATOR
   ============================================================ */

.bmi-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.bmi-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.bmi-input-wrap input {
  flex: 1;
}

.bmi-unit {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  flex-shrink: 0;
}

.bmi-result-main {
  text-align: center;
  padding: var(--sp-6) 0;
}

.bmi-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: var(--fw-extrabold);
  line-height: 1;
  background: linear-gradient(135deg, var(--c-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bmi-category {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-top: var(--sp-2);
}

.bmi-bar-wrap {
  position: relative;
  margin: var(--sp-4) 0 var(--sp-6);
  padding-top: 12px;
}

.bmi-bar {
  display: flex;
  border-radius: var(--r-full);
  overflow: hidden;
  height: 28px;
}

.bmi-bar-section {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: #fff;
}

.bmi-bar-underweight { flex: 3.5; background: #3b82f6; }
.bmi-bar-normal { flex: 6.5; background: #10b981; }
.bmi-bar-overweight { flex: 5; background: #f59e0b; }
.bmi-bar-obese { flex: 10; background: #ef4444; }

.bmi-bar-marker {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--c-primary);
  transform: translateX(-8px);
  display: none;
  transition: left var(--t-base) var(--ease-out);
}

.bmi-target-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
}

.bmi-target-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-2);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  text-align: center;
  transition: all var(--t-fast) ease;
}

.bmi-target-current {
  border-color: var(--c-primary-200);
  background: var(--c-primary-50);
  box-shadow: var(--shadow-sm);
}

.bmi-target-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.bmi-target-name {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.bmi-target-weight {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.bmi-target-diff {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

@media (max-width: 768px) {
  .bmi-target-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .bmi-input-row { grid-template-columns: 1fr; }
  .bmi-number { font-size: 3rem; }
  .bmi-bar-section { font-size: 8px; }
  .bmi-target-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   26. PASSWORD GENERATOR
   ============================================================ */

/* Presets */
.pw-presets {
  margin-bottom: var(--sp-5);
}

.pw-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.pw-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-3);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-base) var(--ease-out);
  text-align: center;
  font-family: var(--font-main);
}

.pw-preset:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pw-preset-icon {
  font-size: var(--fs-2xl);
  line-height: 1;
}

.pw-preset-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.pw-preset-detail {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

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

/* Length input */
.pw-length-input {
  width: 64px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
  padding: var(--sp-2) !important;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
}

.pw-display-card {
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
}

.pw-display {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  padding: var(--sp-4);
  background: var(--c-bg-input);
  border-radius: var(--r-md);
  text-align: center;
  word-break: break-all;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background var(--t-fast) ease;
  line-height: 1.6;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-display:hover {
  background: var(--c-primary-50);
}

.pw-char-upper { color: #3b82f6; }
.pw-char-lower { color: var(--c-text); }
.pw-char-num { color: #10b981; font-weight: var(--fw-extrabold); }
.pw-char-sym { color: #f59e0b; font-weight: var(--fw-extrabold); }

.pw-strength-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.pw-strength-bar {
  flex: 1;
  height: 8px;
  background: var(--c-border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width var(--t-base) ease, background var(--t-base) ease;
}

.pw-strength-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

/* Settings panel */
.pw-settings {
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
}

.pw-length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.pw-length-value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
}

.pw-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--c-border);
  border-radius: var(--r-full);
  outline: none;
  margin-bottom: var(--sp-5);
}

.pw-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--c-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.pw-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.pw-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  text-align: center;
}

.pw-option-card:has(input:checked) {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
.pw-option-card:has(input:checked) .pw-option-label,
.pw-option-card:has(input:checked) .pw-option-desc {
  color: var(--c-primary);
}

.pw-option-card input {
  display: none;
}

.pw-option-label {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.pw-option-desc {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

@media (max-width: 480px) {
  .pw-options-grid { grid-template-columns: repeat(2, 1fr); }
  .pw-display { font-size: var(--fs-lg); }
}

/* ============================================================
   27. JSON FORMATTER
   ============================================================ */

.json-output-pre {
  padding: var(--sp-5);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  color: var(--c-text);
  max-height: 500px;
  overflow-y: auto;
  line-height: var(--lh-relaxed);
}

.json-key { color: #2563eb; font-weight: var(--fw-semibold); }
.json-string { color: #059669; }
.json-number { color: #d97706; }
.json-boolean { color: #8b5cf6; font-weight: var(--fw-bold); }
.json-null { color: #94a3b8; font-style: italic; }

[data-theme="dark"] .json-key { color: #60a5fa; }
[data-theme="dark"] .json-string { color: #34d399; }
[data-theme="dark"] .json-number { color: #fbbf24; }
[data-theme="dark"] .json-boolean { color: #a78bfa; }
[data-theme="dark"] .json-null { color: #64748b; }

/* ============================================================
   28. TEDORI CALCULATOR
   ============================================================ */

.tedori-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast) ease;
}
.tedori-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.tedori-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  min-width: 0;
}
.tedori-unit {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.tedori-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.tedori-select-wrap select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-fast) ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.tedori-select-wrap select:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* メイン結果 */
.tedori-main-result {
  text-align: center;
  padding: var(--sp-6) 0;
}
.tedori-main-label {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}
.tedori-main-value {
  font-size: 2.5rem;
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-primary);
  line-height: 1.2;
}
.tedori-monthly {
  font-size: var(--fs-base);
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
}
.tedori-monthly span {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}

/* 比率バー */
.tedori-ratio-bar {
  display: flex;
  height: 12px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--c-bg);
  margin-bottom: var(--sp-3);
}
.tedori-ratio-fill {
  transition: width var(--t-base) var(--ease-out);
  min-width: 0;
}
.tedori-fill-tedori { background: #10b981; }
.tedori-fill-shakai { background: #3b82f6; }
.tedori-fill-shotoku { background: #f59e0b; }
.tedori-fill-jumin  { background: #8b5cf6; }

.tedori-ratio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-5);
}
.tedori-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.tedori-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  display: inline-block;
}

/* 内訳テーブル */
.tedori-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.tedori-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}
.tedori-breakdown-label {
  color: var(--c-text-secondary);
}
.tedori-breakdown-value {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.tedori-breakdown-subtotal {
  border-top: 1px dashed var(--c-border);
  padding-top: var(--sp-3);
  margin-top: var(--sp-1);
}
.tedori-breakdown-subtotal .tedori-breakdown-label,
.tedori-breakdown-subtotal .tedori-breakdown-value {
  color: var(--c-text);
  font-weight: var(--fw-semibold);
}
.tedori-breakdown-total {
  border-top: 2px solid var(--c-border);
  padding-top: var(--sp-3);
  margin-top: var(--sp-1);
}
.tedori-breakdown-total .tedori-breakdown-label {
  font-weight: var(--fw-bold);
  color: var(--c-text);
}
.tedori-breakdown-total .tedori-breakdown-value {
  font-weight: var(--fw-bold);
  color: #ef4444;
  font-size: var(--fs-sm);
}

/* 早見表 */
.tedori-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tedori-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tedori-table th {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  border-bottom: 2px solid var(--c-border);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.tedori-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  white-space: nowrap;
}
.tedori-table-current {
  background: var(--c-primary-50);
}
.tedori-table-current td {
  font-weight: var(--fw-semibold);
  color: var(--c-primary);
}

@media (max-width: 480px) {
  .tedori-options {
    grid-template-columns: 1fr;
  }
  .tedori-main-value {
    font-size: 2rem;
  }
  .tedori-ratio-legend {
    gap: var(--sp-2);
  }
}

/* ============================================================
   29. CALORIE CALCULATOR
   ============================================================ */

.cal-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.cal-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast) ease;
}
.cal-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.cal-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  min-width: 0;
}
.cal-unit {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

/* 性別ボタン */
.cal-gender-wrap {
  display: flex;
  gap: var(--sp-2);
}
.cal-gender-btn {
  flex: 1;
  cursor: pointer;
}
.cal-gender-btn input { display: none; }
.cal-gender-btn span {
  display: block;
  text-align: center;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}
.cal-gender-btn input:checked + span {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}

/* 活動レベルカード */
.cal-activity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-2);
}
.cal-activity-card {
  cursor: pointer;
  padding: var(--sp-3);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
  text-align: center;
}
.cal-activity-card input { display: none; }
.cal-activity-card:has(input:checked) {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
.cal-activity-name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}
.cal-activity-desc {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}
.cal-activity-card:has(input:checked) .cal-activity-name {
  color: var(--c-primary);
}

/* メイン結果カード */
.cal-main-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.cal-main-card {
  text-align: center;
  padding: var(--sp-5);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.cal-main-card-primary {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
.cal-main-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}
.cal-main-value {
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  line-height: 1.2;
}
.cal-main-card-primary .cal-main-value {
  color: var(--c-primary);
}
.cal-main-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-2);
}

/* 目的別カード */
.cal-goal-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.cal-goal-card {
  text-align: center;
  padding: var(--sp-4) var(--sp-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-bg-card);
}
.cal-goal-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-2);
}
.cal-goal-value {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}
.cal-goal-desc {
  font-size: 0.6875rem;
  color: var(--c-text-muted);
}
.cal-goal-lose .cal-goal-label { color: #ef4444; }
.cal-goal-slow-lose .cal-goal-label { color: #f59e0b; }
.cal-goal-maintain .cal-goal-label { color: #10b981; }
.cal-goal-gain .cal-goal-label { color: #3b82f6; }

/* PFCバランス */
.cal-pfc-bar {
  display: flex;
  height: 12px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--c-bg);
  margin-bottom: var(--sp-3);
}
.cal-pfc-fill {
  transition: width var(--t-base) var(--ease-out);
}
.cal-pfc-p { background: #ef4444; }
.cal-pfc-f { background: #f59e0b; }
.cal-pfc-c { background: #3b82f6; }
.cal-pfc-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  display: inline-block;
  flex-shrink: 0;
}
.cal-pfc-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.cal-pfc-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}
.cal-pfc-name {
  color: var(--c-text-secondary);
  min-width: 120px;
}
.cal-pfc-gram {
  font-weight: var(--fw-bold);
  color: var(--c-text);
  font-family: var(--font-mono);
  min-width: 50px;
}
.cal-pfc-kcal {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

@media (max-width: 768px) {
  .cal-goal-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .cal-input-grid {
    grid-template-columns: 1fr;
  }
  .cal-main-cards {
    grid-template-columns: 1fr;
  }
  .cal-main-value {
    font-size: 1.5rem;
  }
  .cal-activity-cards {
    grid-template-columns: 1fr 1fr;
  }
  .cal-pfc-name {
    min-width: 80px;
  }
}

/* ============================================================
   30. PERCENT CALCULATOR
   ============================================================ */

.pct-section {
  padding: var(--sp-5);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-4);
}
.pct-section:last-child {
  margin-bottom: 0;
}
.pct-section-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-4);
}
.pct-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.pct-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  flex: 1;
  min-width: 80px;
  transition: border-color var(--t-fast) ease;
}
.pct-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.pct-input-short {
  flex: 0 0 auto;
  min-width: 70px;
  max-width: 100px;
}
.pct-input-wrap input {
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  width: 100%;
  min-width: 0;
}
.pct-unit {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
}
.pct-label {
  font-size: var(--fs-base);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  flex-shrink: 0;
}
.pct-result-inline {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-bg);
  border: 1.5px dashed var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text-muted);
  min-width: 80px;
  text-align: center;
  flex: 1;
  transition: all var(--t-fast) ease;
}
.pct-result-active {
  color: var(--c-primary);
  background: var(--c-primary-50);
  border-color: var(--c-primary);
  border-style: solid;
}

/* 増し/引きトグル */
.pct-toggle-wrap {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.pct-toggle-btn {
  cursor: pointer;
}
.pct-toggle-btn input { display: none; }
.pct-toggle-btn span {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}
.pct-toggle-btn input:checked + span {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}

@media (max-width: 480px) {
  .pct-row {
    gap: var(--sp-2);
  }
  .pct-input-wrap input {
    font-size: var(--fs-base);
  }
  .pct-result-inline {
    font-size: var(--fs-base);
    min-width: 60px;
  }
}

/* ============================================================
   31. DAYS CALCULATOR
   ============================================================ */

.days-section {
  padding: var(--sp-6);
  background: var(--c-bg-elevated, var(--c-bg-card));
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-5);
}
.days-section-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-4);
}
.days-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.days-grid-3col {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-4);
  align-items: end;
}
.days-date-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) ease;
}
.days-date-input:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}
.days-num-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.days-num-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.days-num-wrap input {
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-text);
  width: 80px;
  min-width: 0;
}
.days-unit {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
.days-today-badge {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg);
  border-radius: var(--r-md);
  display: inline-block;
}

/* 後/前トグル */
.days-toggle-wrap {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.days-toggle-btn { cursor: pointer; flex: 1; }
.days-toggle-btn input { display: none; }
.days-toggle-btn span {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
  text-align: center;
}
.days-toggle-btn input:checked + span {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}

/* クイックボタン（カード型） */
.days-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.days-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  font-family: var(--font-main);
}
.days-quick-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
.days-quick-num {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-primary);
}
.days-quick-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* 結果カード */
.days-result-card {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--c-primary-50);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-md);
  text-align: center;
}
.days-result-main {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--c-primary);
}
.days-result-details {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
}

@media (max-width: 480px) {
  .days-grid-2col { grid-template-columns: 1fr; }
  .days-grid-3col { grid-template-columns: 1fr; }
  .days-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   32. TEXT CONVERTER
   ============================================================ */

.tconv-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.tconv-mode-card {
  cursor: pointer;
}
.tconv-mode-card input { display: none; }
.tconv-mode-card .tconv-mode-name {
  display: block;
  text-align: center;
  padding: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}
.tconv-mode-card input:checked + .tconv-mode-name {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}

.tconv-targets {
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}
.tconv-target-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.tconv-check {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  cursor: pointer;
}

#tconv-output {
  font-family: var(--font-mono);
  background: var(--c-bg-input);
}

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

/* ============================================================
   33. BASE64 TOOL
   ============================================================ */

.b64-mode-wrap {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.b64-mode-btn {
  flex: 1;
  cursor: pointer;
}
.b64-mode-btn input { display: none; }
.b64-mode-btn span {
  display: block;
  text-align: center;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}
.b64-mode-btn input:checked + span {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}
.b64-options {
  margin: var(--sp-3) 0 var(--sp-4);
}

/* ============================================================
   34. TIMESTAMP CONVERTER
   ============================================================ */

.ts-now-card {
  text-align: center;
  padding: var(--sp-5);
  background: var(--c-bg-elevated, var(--c-bg-card));
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-5);
}
.ts-now-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}
.ts-now-value {
  font-size: 2rem;
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  color: var(--c-primary);
  line-height: 1.2;
}
.ts-now-date {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
}
.ts-now-card:hover {
  border-color: var(--c-primary);
}
.ts-now-btns {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-4);
}
.ts-copy-btn {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  font-family: var(--font-main);
  font-weight: var(--fw-medium);
  color: var(--c-primary);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
}
.ts-copy-btn:hover {
  background: var(--c-primary);
  color: #fff;
}

.ts-section {
  padding: var(--sp-6);
  background: var(--c-bg-elevated, var(--c-bg-card));
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-5);
}
.ts-section-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-4);
}
.ts-row {
  display: flex;
  gap: var(--sp-4);
}
.ts-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.ts-input-wrap:focus-within {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.ts-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  color: var(--c-text);
  min-width: 0;
}
.ts-unit-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  white-space: nowrap;
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-bg);
  border-radius: var(--r-sm);
}

.ts-datetime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

/* 結果行 */
.ts-result-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.ts-result-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.ts-result-row .ts-result-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  min-width: 90px;
  flex-shrink: 0;
}
.ts-result-row .ts-result-value {
  flex: 1;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  word-break: break-all;
}
.ts-mono {
  font-family: var(--font-mono);
}
.ts-row-copy {
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-xs);
  font-family: var(--font-main);
  color: var(--c-primary);
  background: transparent;
  border: 1px solid var(--c-primary);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.ts-row-copy:hover {
  background: var(--c-primary);
  color: #fff;
}

.ts-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--sp-4);
  align-items: end;
}
.ts-result-card {
  margin-top: var(--sp-4);
}

@media (max-width: 480px) {
  .ts-now-value { font-size: 1.5rem; }
  .ts-result-row { flex-wrap: wrap; }
  .ts-result-row .ts-result-label { min-width: 80px; }
  .ts-now-btns { flex-direction: column; gap: var(--sp-2); }
  .ts-picker-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-form .tool-input-group {
  margin-bottom: var(--sp-6);
}

.contact-required {
  color: var(--c-error);
  font-weight: var(--fw-bold);
}

.contact-error {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--r-md);
  color: var(--c-error);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-6);
}

.contact-success {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
}

.contact-success-icon {
  color: var(--c-success);
  margin-bottom: var(--sp-4);
}

.contact-success-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-3);
}

.contact-success-text {
  color: var(--c-text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
}

.contact-note {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.contact-note a {
  color: var(--c-primary);
  text-decoration: underline;
}

/* ============================================================
   DISCOUNT CALCULATOR
   ============================================================ */
/* ---- discount ---- */
#discount-tool .pct-unit {
  font-size: var(--fs-xs);
}
#discount-tool .pct-input-wrap {
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
}
#discount-tool .pct-input-wrap input {
  min-width: 60px;
}

.disc-result-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
}
.disc-result-label {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  flex-shrink: 0;
}
.disc-result-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  font-family: var(--font-display);
  color: var(--c-primary);
}
.disc-result-note {
  font-size: var(--fs-sm);
  color: var(--c-success);
  font-weight: var(--fw-medium);
  margin-left: auto;
}
[data-theme="dark"] .disc-result-row {
  background: var(--c-bg-input);
}
.disc-detail-result {
  margin-top: var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.disc-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border);
}
.disc-detail-row:last-child { border-bottom: none; }
.disc-detail-total {
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: var(--c-primary);
  padding-top: var(--sp-3);
}
[data-theme="dark"] .disc-detail-result {
  background: var(--c-bg-input);
}

/* ============================================================
   SLEEP CALCULATOR
   ============================================================ */
.sleep-results {
  margin-top: var(--sp-5);
}
.sleep-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.sleep-card {
  text-align: center;
  padding: var(--sp-4) var(--sp-3);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  position: relative;
}
.sleep-card-time {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  font-family: var(--font-display);
  color: var(--c-text);
}
.sleep-card-info {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}
.sleep-recommended {
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}
[data-theme="dark"] .sleep-recommended {
  background: rgba(37, 99, 235, 0.1);
}
.sleep-recommended .sleep-card-time {
  color: var(--c-primary);
}
.sleep-card-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.sleep-note {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-3);
  text-align: center;
}
@media (max-width: 480px) {
  .sleep-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   CIPHER TOOL
   ============================================================ */
.cipher-option {
  margin-bottom: var(--sp-4);
}

/* ============================================================
   UUID GENERATOR
   ============================================================ */
.uuid-output {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
  text-align: center;
  padding: var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  word-break: break-all;
  user-select: all;
}
.uuid-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  justify-content: center;
}

/* ============================================================
   SNS COUNTER
   ============================================================ */
.sns-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-1);
  margin-bottom: var(--sp-5);
  background: var(--c-bg);
  padding: var(--sp-1);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--c-border);
}
.sns-tab {
  padding: var(--sp-2) var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  font-family: var(--font-main);
  color: var(--c-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  text-align: center;
  white-space: nowrap;
}
.sns-tab:hover {
  color: var(--c-text);
  background: var(--c-bg-card);
}
.sns-tab.active {
  background: var(--c-primary);
  color: #fff;
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm);
}
.sns-count-bar {
  height: 8px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-2);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.sns-count-progress {
  height: 100%;
  background: var(--c-primary);
  border-radius: var(--r-full);
  transition: width var(--t-fast) ease, background var(--t-fast) ease;
  width: 0;
}
.sns-count-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-4);
}
.sns-count-remaining {
  margin-left: auto;
  font-weight: var(--fw-semibold);
}
.sns-details {
  background: var(--c-bg);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
@media (max-width: 600px) {
  .sns-tabs { grid-template-columns: repeat(3, 1fr); }
  .sns-tab { font-size: var(--fs-xs); padding: var(--sp-2) var(--sp-1); }
}

/* ============================================================
   DATA CONVERTER
   ============================================================ */
.dc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.dc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}
.dc-panel-header label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
.dc-panel-header select {
  width: auto;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  padding-right: 32px;
}
#dc-input, #dc-output {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.dc-error {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--r-md);
  color: var(--c-error);
  font-size: var(--fs-sm);
}
@media (max-width: 768px) {
  .dc-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   HASH GENERATOR
   ============================================================ */
.hash-results {
  margin: var(--sp-5) 0;
}
.hash-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
}
.hash-row:last-child { border-bottom: none; }
.hash-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--c-text-muted);
  min-width: 65px;
  flex-shrink: 0;
}
.hash-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text);
  word-break: break-all;
  flex: 1;
  line-height: 1.5;
}
.hash-copy {
  font-size: var(--fs-xs);
  padding: var(--sp-1) var(--sp-3);
  flex-shrink: 0;
}
.hash-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
}

/* ============================================================
   COLOR CONVERTER
   ============================================================ */
.clr-main {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.clr-preview-wrap {
  position: relative;
}
.clr-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  border: 2px solid var(--c-border);
  background: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.clr-preview-hint {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.7);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none;
  line-height: 1.4;
}
.clr-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.clr-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.clr-input-group label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.clr-rgb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
#color-tool .pct-input-wrap {
  min-width: 0;
}
#color-tool .pct-input-wrap input {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}
.clr-copy-row {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.clr-copy-row .btn {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.clr-contrast-section {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}
.clr-contrast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.clr-contrast-demo {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clr-contrast-sample {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}
.clr-contrast-ratio {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
}

@media (max-width: 480px) {
  .clr-main {
    grid-template-columns: 1fr;
  }
  .clr-preview {
    aspect-ratio: 3/1;
  }
  .clr-copy-row {
    flex-direction: column;
  }
  .clr-contrast-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   TEXT CLEANER
   ============================================================ */
.tc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.tc-btn {
  font-size: var(--fs-xs);
  padding: var(--sp-2) var(--sp-3);
}
.tc-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}
#tc-output {
  background: var(--c-bg);
}

/* ============================================================
   TSUBO CONVERTER
   ============================================================ */
.tsubo-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.tsubo-input-wrap {
  position: relative;
}

.tsubo-result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.tsubo-result-card {
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
  background: var(--c-bg);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}

.tsubo-result-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.tsubo-result-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
  font-family: var(--font-display);
}

.tsubo-result-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* 畳の種類別 */
.tsubo-tatami-section {
  margin-bottom: var(--sp-6);
}

.tsubo-tatami-title,
.tsubo-visual-title,
.tsubo-table-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}

.tsubo-tatami-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}

.tsubo-tatami-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.tsubo-tatami-name {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  min-width: 110px;
}

.tsubo-tatami-size {
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  min-width: 85px;
}

.tsubo-tatami-val {
  font-weight: var(--fw-bold);
  color: var(--c-primary);
  margin-left: auto;
}

/* 面積ビジュアル */
.tsubo-visual-section {
  margin-bottom: var(--sp-4);
}

.tsubo-visual-bar-wrap {
  background: var(--c-bg);
  border-radius: var(--r-md);
  height: 40px;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--sp-2);
}

.tsubo-visual-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  border-radius: var(--r-md);
  transition: width var(--t-base) var(--ease-out);
  min-width: 0;
}

.tsubo-visual-label {
  position: absolute;
  top: 50%;
  left: var(--sp-4);
  transform: translateY(-50%);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  white-space: nowrap;
}

.tsubo-visual-label.on-bar {
  color: var(--c-text-inverse);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tsubo-visual-refs {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  text-align: center;
}

.tsubo-visual-ref small {
  color: var(--c-text-muted);
  opacity: 0.7;
}

/* 早見表 */
.tsubo-table-section {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
}

.tsubo-table-wrap {
  overflow-x: auto;
}

.tsubo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.tsubo-table th,
.tsubo-table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: right;
  border-bottom: 1px solid var(--c-border);
}

.tsubo-table th {
  font-weight: var(--fw-semibold);
  color: var(--c-text-secondary);
  background: var(--c-bg);
  text-align: right;
}

.tsubo-table td:last-child,
.tsubo-table th:last-child {
  text-align: left;
}

.tsubo-table tbody tr:hover {
  background: var(--c-primary-50);
}

[data-theme="dark"] .tsubo-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}

@media (max-width: 768px) {
  .tsubo-result-cards {
    grid-template-columns: 1fr;
  }
  .tsubo-tatami-grid {
    grid-template-columns: 1fr;
  }
  .tsubo-input-row {
    grid-template-columns: 1fr;
  }
  .tsubo-visual-refs {
    font-size: 0.65rem;
  }
}

/* ============================================================
   HTML STRIP
   ============================================================ */
.hs-tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.hs-tag-check {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.hs-tag-check input[type="checkbox"] {
  margin: 0;
}
.hs-preview-box {
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--fs-sm);
  color: var(--text);
}

/* ============================================================
   KYUJITAI
   ============================================================ */
.kj-diff-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
.kj-diff-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
}
.kj-diff-from {
  color: var(--c-danger, #e53e3e);
  font-weight: 700;
  font-size: var(--fs-base);
}
.kj-diff-to {
  color: var(--c-primary);
  font-weight: 700;
  font-size: var(--fs-base);
}

/* ============================================================
   CHARCODE TOOL
   ============================================================ */
.cc-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.cc-table th,
.cc-table td {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.cc-table th {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
}
.cc-char-cell {
  font-size: var(--fs-lg);
  text-align: center;
  min-width: 40px;
}
.cc-mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: var(--fs-xs);
}

/* ============================================================
   ESCAPE TOOL
   ============================================================ */
.esc-tab.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ============================================================
   MARKDOWN PREVIEW
   ============================================================ */
.md-tab.active,
.md-view-btn.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.md-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 768px) {
  .md-editor-grid {
    grid-template-columns: 1fr;
  }
}
.md-preview-box {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  line-height: 1.7;
  color: var(--text);
}
.md-preview-box h1 { font-size: 1.6em; margin: 0.6em 0 0.3em; border-bottom: 1px solid var(--border); padding-bottom: 0.2em; }
.md-preview-box h2 { font-size: 1.3em; margin: 0.5em 0 0.3em; border-bottom: 1px solid var(--border); padding-bottom: 0.2em; }
.md-preview-box h3 { font-size: 1.1em; margin: 0.4em 0 0.2em; }
.md-preview-box p { margin: 0.5em 0; }
.md-preview-box ul, .md-preview-box ol { padding-left: 1.5em; margin: 0.5em 0; }
.md-preview-box li { margin: 0.2em 0; }
.md-preview-box code {
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.md-preview-box pre {
  background: var(--bg-secondary);
  padding: var(--sp-3);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0.5em 0;
}
.md-preview-box pre code { background: none; padding: 0; }
.md-preview-box blockquote {
  border-left: 3px solid var(--c-primary);
  padding: var(--sp-2) var(--sp-3);
  margin: 0.5em 0;
  color: var(--text-muted, #666);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.md-preview-box table { border-collapse: collapse; width: 100%; margin: 0.5em 0; }
.md-preview-box th, .md-preview-box td { border: 1px solid var(--border); padding: var(--sp-2); text-align: left; }
.md-preview-box th { background: var(--c-primary); color: #fff; }
.md-preview-box hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.md-preview-box img { max-width: 100%; }

/* ============================================================
   CSS GENERATOR
   ============================================================ */
.cssg-tab.active,
.cssg-gr-type.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.cssg-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--sp-6);
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50%/20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.cssg-preview {
  width: 200px;
  height: 200px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #333;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.cssg-controls {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.cssg-controls label {
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.cssg-controls input[type="range"] {
  width: 100%;
}
.cssg-controls input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

/* ============================================================
   TOOLS LIST PAGE
   ============================================================ */
.tools-cat-section {
  margin-bottom: var(--sp-8);
}
.tools-cat-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--c-primary);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.tools-cat-count {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted, #999);
}
.tools-cat-count::before { content: '('; }
.tools-cat-count::after { content: ')'; }
.tools-list {
  display: flex;
  flex-direction: column;
}
.tools-list-item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.tools-list-item:hover {
  background: var(--bg-secondary);
}
.tools-list-name {
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--c-primary);
}
.tools-list-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted, #999);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .tools-list-item {
    flex-direction: column;
    gap: 0;
  }
  .tools-list-desc {
    white-space: normal;
  }
}
