/* ===== Google Material Design Tokens ===== */
:root {
  --color-primary: #1a73e8;
  --color-primary-hover: #1557b0;
  --color-primary-light: #e8f0fe;
  --color-primary-dark: #174ea6;
  --color-secondary: #ea4335;
  --color-accent: #34a853;
  --color-success: #34a853;
  --color-error: #ea4335;
  --color-warning: #fbbc04;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-surface: #f1f3f4;
  --color-surface-2: #e8eaed;
  --color-text: #202124;
  --color-text-muted: #5f6368;
  --color-text-light: #80868b;
  --color-border: #dadce0;
  --color-border-focus: #1a73e8;
  --gradient-primary: #1a73e8;
  --gradient-subtle: #f8f9fa;
  --gradient-hero: #f8f9fa;
  --gradient-card: #f8f9fa;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --shadow-lg: 0 1px 3px 0 rgba(60,64,67,0.3), 0 8px 16px 6px rgba(60,64,67,0.15);
  --shadow-glow: 0 0 0 3px rgba(26,115,232,0.2);
  --font: 'Inter', 'Google Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Google Sans Mono', 'SF Mono', 'Fira Code', monospace;
  --max-width: 1280px;
  --header-h: 64px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --color-primary: #8ab4f8;
  --color-primary-hover: #aecbfa;
  --color-primary-light: rgba(138,180,248,0.08);
  --color-primary-dark: #d2e3fc;
  --color-secondary: #f28b82;
  --color-accent: #81c995;
  --color-bg: #202124;
  --color-bg-alt: #292a2d;
  --color-surface: #292a2d;
  --color-surface-2: #35363a;
  --color-text: #e8eaed;
  --color-text-muted: #9aa0a6;
  --color-text-light: #9aa0a6;
  --color-border: #3c4043;
  --color-border-focus: #8ab4f8;
  --gradient-primary: #8ab4f8;
  --gradient-subtle: #292a2d;
  --gradient-hero: #202124;
  --gradient-card: #292a2d;
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.5), 0 1px 2px 0 rgba(0,0,0,0.4);
  --shadow-md: 0 2px 6px 0 rgba(0,0,0,0.5), 0 4px 12px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px 0 rgba(0,0,0,0.5), 0 8px 24px 4px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 0 3px rgba(138,180,248,0.25);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: rgba(26,115,232,0.15); color: inherit; }
[data-theme="dark"] ::selection { background: rgba(138,180,248,0.25); }
body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-hover); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem !important;
  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='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
}

/* ===== Layout ===== */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.site-main { min-height: calc(100vh - var(--header-h) - 200px); padding: 2rem 0 3rem; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(60,64,67,0.1);
}
[data-theme="dark"] .site-header {
  background: #202124;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 2.5rem;
}
.logo:hover { color: var(--color-text); }
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  font-size: 0.85rem;
}
.logo-text { font-weight: 400; letter-spacing: -0.01em; }
.logo-text strong { font-weight: 700; }

/* Main nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* Nav links */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  color: var(--color-text-muted);
  font-size: 0.87rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

/* Right side actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover {
  background: var(--color-surface);
  color: var(--color-text);
}
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* Hamburger */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.mobile-menu-btn:hover { background: var(--color-surface); }
.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ===== Categories Dropdown ===== */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  font-family: inherit;
}
.nav-chevron {
  opacity: 0.5;
  transition: transform 0.2s ease;
}
.nav-dropdown.open .nav-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  background: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  padding: 8px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .nav-dropdown-menu {
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.nav-dd-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-dd-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.nav-dd-link span {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* Favorites nav link */
.nav-link--fav {
  color: #ea4335;
  font-weight: 600;
}
.nav-link--fav:hover {
  background: rgba(234, 67, 53, 0.08);
  color: #ea4335;
}
.fav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ea4335;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
  line-height: 1;
}

/* ===== Tool Action Buttons ===== */
.tool-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.tool-header-title { flex: 1; min-width: 0; }
.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tool-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tool-action-btn:hover {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow);
}
.tool-action-btn svg { flex-shrink: 0; transition: all var(--transition); }
.tool-action-btn--fav:hover svg { color: #ea4335; stroke: #ea4335; }
.tool-action-btn--fav.active {
  background: #fce8e6;
  border-color: #ea4335;
  color: #ea4335;
}
.tool-action-btn--fav.active svg {
  fill: #ea4335;
  stroke: #ea4335;
}
[data-theme="dark"] .tool-action-btn--fav.active {
  background: rgba(234,67,53,0.15);
}

@media (max-width: 600px) {
  .tool-header-top { flex-wrap: wrap; }
  .tool-actions { width: 100%; }
  .tool-action-btn span { display: none; }
  .tool-action-btn { padding: 8px; border-radius: 50%; }
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  background: var(--color-bg);
  margin: -2rem -1.5rem 2.5rem;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}
.hero > *:not(.hero-dots):not(.hero-glow) {
  position: relative;
  z-index: 1;
}
.hero-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(26,115,232,0.06), transparent 70%);
}
.hero-glow.active { opacity: 1; }
[data-theme="dark"] .hero-glow {
  background: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(138,180,248,0.05), transparent 70%);
}
@media (prefers-reduced-motion: reduce) {
  .hero-dots, .hero-glow { display: none !important; }
}
.hero h1 {
  font-size: 3rem; font-weight: 700; line-height: 1.15;
  margin-bottom: 1rem; letter-spacing: -0.02em;
  color: var(--color-text);
}
.hero h1 .accent {
  color: var(--color-primary);
  -webkit-text-fill-color: var(--color-primary);
  background: none;
}
.hero-sub {
  font-size: 1.1rem; color: var(--color-text-muted);
  max-width: 560px; margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-search-wrap {
  max-width: 480px; margin: 0 auto 2.5rem; position: relative;
}
.hero-search-wrap .search-input {
  width: 100%; padding: 0.85rem 1.1rem 0.85rem 2.8rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.95rem; color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
  box-shadow: var(--shadow);
}
.hero-search-wrap .search-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.hero-search-wrap .search-input::placeholder { color: var(--color-text-muted); }
.hero-search-wrap .search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); font-size: 1rem; pointer-events: none;
}
[data-theme="dark"] .hero-search-wrap .search-input {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.hero-stats {
  display: flex; justify-content: center; align-items: center;
  gap: 2.5rem; flex-wrap: wrap;
}
.hero-stat {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.hero-stat-num {
  font-size: 1.6rem; font-weight: 700; color: var(--color-text);
  letter-spacing: -0.02em;
}
.hero-stat-label {
  font-size: 0.75rem; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
}
.hero-stat-sep {
  width: 1px; height: 36px; background: var(--color-border);
}
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.badge:hover { border-color: var(--color-primary); color: var(--color-primary); box-shadow: var(--shadow); }
[data-theme="dark"] .badge { background: var(--color-surface); }

/* ===== Tool Count ===== */
.tool-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  background: var(--color-primary-light); color: var(--color-primary);
  border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  margin-left: 0.5rem;
}

/* ===== Search ===== */
.search-wrapper {
  max-width: 480px; margin: 0 auto 2.5rem; position: relative;
}
.search-input {
  width: 100%; padding: 0.85rem 1.1rem 0.85rem 2.8rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.95rem; color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.search-input:focus { border-color: var(--color-primary); box-shadow: var(--shadow); }
[data-theme="dark"] .search-input { background: var(--color-surface); border-color: var(--color-border); }
.search-input::placeholder { color: var(--color-text-muted); }
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); font-size: 1rem; pointer-events: none;
}

/* ===== Category Section ===== */
.category-section { margin-bottom: 3rem; }
.category-header {
  display: flex; align-items: center; gap: 0.85rem;
  margin-bottom: 1.25rem; padding-bottom: 0;
  border-bottom: none;
}
.category-count {
  background: var(--color-surface);
  border: none;
  padding: 4px 12px;
  border-radius: 24px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.category-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  font-size: 1.05rem; font-weight: 700;
}
.category-icon--text { background: #e8f0fe; color: #1a73e8; }
.category-icon--developer { background: #e6f4ea; color: #1e8e3e; }
.category-icon--converter { background: #fef7e0; color: #e37400; }
.category-icon--generator { background: #fce8e6; color: #c5221f; }
.category-icon--image { background: #e8eaf6; color: #4a3cb5; }
.category-icon--security { background: #fce8e6; color: #c5221f; }
.category-icon--finance { background: #e6f4ea; color: #137333; }
.category-icon--health { background: #fce8e6; color: #c5221f; }
.category-icon--everyday { background: #fef7e0; color: #e37400; }
.category-icon--design { background: #f3e8fd; color: #8430ce; }
.category-icon--seo { background: #e8f0fe; color: #1a73e8; }
.category-icon--data { background: #e6f4ea; color: #1e8e3e; }
.category-icon--life { background: #fce8e6; color: #ea4335; }
[data-theme="dark"] .category-icon--text { background: rgba(138,180,248,0.12); color: #8ab4f8; }
[data-theme="dark"] .category-icon--developer { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .category-icon--converter { background: rgba(253,214,99,0.12); color: #fdd663; }
[data-theme="dark"] .category-icon--generator { background: rgba(242,139,130,0.12); color: #f28b82; }
[data-theme="dark"] .category-icon--image { background: rgba(175,163,248,0.12); color: #afa3f8; }
[data-theme="dark"] .category-icon--security { background: rgba(242,139,130,0.1); color: #f28b82; }
[data-theme="dark"] .category-icon--finance { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .category-icon--health { background: rgba(242,139,130,0.12); color: #f28b82; }
[data-theme="dark"] .category-icon--everyday { background: rgba(253,214,99,0.12); color: #fdd663; }
[data-theme="dark"] .category-icon--design { background: rgba(193,168,246,0.12); color: #c1a8f6; }
[data-theme="dark"] .category-icon--seo { background: rgba(138,180,248,0.12); color: #8ab4f8; }
[data-theme="dark"] .category-icon--data { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .category-icon--life { background: rgba(242,139,130,0.12); color: #f28b82; }
.category-title {
  font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em;
  flex: 1;
}
/* ===== Tools Grid ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}
.tools-grid-sm { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.tool-card {
  display: flex; flex-direction: row; align-items: center;
  padding: 0.9rem 1.1rem;
  gap: 0.9rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none; color: var(--color-text);
  position: relative;
  box-shadow: none;
}
.tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-1px);
}
[data-theme="dark"] .tool-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.tool-card--security:hover { border-color: #ea4335; box-shadow: 0 1px 3px 0 rgba(234,67,53,0.2), 0 4px 8px 3px rgba(234,67,53,0.1); }
.tool-card-icon {
  font-size: 1.3rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  border-radius: 12px;
  flex-shrink: 0;
}
[data-theme="dark"] .tool-card-icon {
  background: var(--color-surface-2);
}
.tool-card-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.tool-card-name {
  font-weight: 500; font-size: 0.92rem;
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-card-desc {
  font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-card-arrow {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
  flex-shrink: 0;
  margin-right: 2rem;
}
.tool-card:hover .tool-card-arrow {
  opacity: 0.6;
  transform: translateX(0);
}

.tool-card-sm { padding: 0.7rem; gap: 0.6rem; }
.tool-card-sm .tool-card-icon { width: 32px; height: 32px; font-size: 0.85rem; border-radius: 8px; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  font-size: 0.85rem; color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { opacity: 0.4; }

/* ===== Tool Page ===== */
.tool-header { margin-bottom: 1.5rem; }
.tool-header h1 {
  font-size: 2.2rem; font-weight: 700; margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.tool-tagline { color: var(--color-text-muted); font-size: 1.05rem; }

.tool-workspace {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

/* ===== Tool UI Components ===== */
.tool-input, .tool-output {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-text);
  resize: vertical; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tool-input:focus, .tool-output:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.12);
}
[data-theme="dark"] .tool-input:focus, [data-theme="dark"] .tool-output:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(138,180,248,0.15);
}

.tool-actions { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }

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

.tool-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 0.45rem; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem; margin-top: 1rem;
}
.stat-card {
  text-align: center; padding: 1.1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: none;
}
.stat-card:hover { box-shadow: var(--shadow); border-color: var(--color-primary); }
.stat-card span { display: block; font-size: 1.75rem; font-weight: 700; color: var(--color-primary); }
.stat-card label { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.2rem; display: block; text-transform: uppercase; letter-spacing: 0.03em; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.88rem; font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; box-shadow: var(--shadow); }
.btn-primary {
  background: var(--color-primary); color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(26,115,232,0.3);
}
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(26,115,232,0.4); }
.btn-gradient {
  background: var(--color-primary); color: #fff; border: none;
}
.btn-gradient:hover { background: var(--color-primary-hover); color: #fff; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; border-radius: 16px; }
.btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-error, .btn-danger { background: var(--color-error); color: #fff; border-color: var(--color-error); }
.btn-error:hover, .btn-danger:hover { background: #c5221f; border-color: #c5221f; color: #fff; }
.btn-success:hover { background: #137333; border-color: #137333; color: #fff; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

/* ===== Share ===== */
.tool-share {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem 0; font-size: 0.9rem; color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

/* ===== Tool Section ===== */
.tool-section { margin-bottom: 2.5rem; }
.tool-section h2 {
  font-size: 1.35rem; font-weight: 600; margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* ===== How To ===== */
.how-to-list { list-style: none; padding-left: 0; counter-reset: howto; }
.how-to-list li {
  padding: 0.65rem 0 0.65rem 2.5rem; position: relative;
  color: var(--color-text-muted); counter-increment: howto;
}
.how-to-list li::before {
  content: counter(howto);
  position: absolute; left: 0; top: 0.55rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light); color: var(--color-primary);
  border-radius: 50%; font-size: 0.8rem; font-weight: 700;
}

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden; transition: all var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow); }
[data-theme="dark"] .faq-item:hover { box-shadow: var(--shadow); }
.faq-item summary {
  padding: 1.1rem 1.35rem; font-weight: 500; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--color-primary-light); }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--color-primary); font-weight: 300; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item[open] summary { background: var(--color-primary-light); }
.faq-item p { padding: 0 1.35rem 1.1rem; color: var(--color-text-muted); line-height: 1.7; }

/* ===== Color picker specific ===== */
.color-preview {
  width: 100%; height: 80px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); cursor: pointer; position: relative;
  box-shadow: var(--shadow);
}
.color-preview input[type="color"] {
  opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer;
}

/* ===== Regex specific ===== */
.match-highlight { background: #fef08a; color: #1e293b; border-radius: 3px; padding: 1px 3px; }
[data-theme="dark"] .match-highlight { background: #854d0e; color: #fef9c3; }

/* ===== Diff specific ===== */
.diff-added { background: #e6f4ea; color: #137333; }
.diff-removed { background: #fce8e6; color: #c5221f; }
[data-theme="dark"] .diff-added { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .diff-removed { background: rgba(242,139,130,0.12); color: #f28b82; }
.diff-output { font-family: var(--font-mono); font-size: 0.85rem; white-space: pre-wrap; }
.diff-line { padding: 2px 8px; display: block; }

/* ===== Password strength ===== */
.strength-bar { height: 8px; border-radius: 4px; background: var(--color-border); overflow: hidden; margin: 0.5rem 0; }
.strength-fill { height: 100%; border-radius: 4px; transition: width 0.3s, background 0.3s; }

/* ===== Toggle / Checkbox group ===== */
.option-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0; }
.option-group label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; cursor: pointer; color: var(--color-text-muted);
  padding: 0.35rem 0.6rem; border-radius: 24px;
  transition: all var(--transition);
}
.option-group label:hover { background: var(--color-primary-light); color: var(--color-primary); }
.option-group input[type="checkbox"],
.option-group input[type="radio"] { accent-color: var(--color-primary); }

.input-group { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0; }
.input-group label { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group input:focus, .input-group select:focus { border-color: var(--color-border-focus); box-shadow: 0 0 0 2px rgba(26,115,232,0.12); }

.input-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.75rem 0; }
.input-field { flex: 1; min-width: 150px; }
.input-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.input-field input, .input-field textarea, .input-field select {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text); outline: none; font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-field input:focus, .input-field textarea:focus, .input-field select:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.12);
}

/* ===== Code output ===== */
.code-output {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem; font-family: var(--font-mono); font-size: 0.85rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  position: relative; min-height: 3.5rem;
}
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  padding: 0.35rem 0.7rem; font-size: 0.75rem;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 16px; cursor: pointer; color: var(--color-text-muted);
  transition: all var(--transition);
}
.copy-btn:hover { border-color: var(--color-primary); color: var(--color-primary); box-shadow: var(--shadow); }

/* ===== File drop ===== */
.file-drop {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius); padding: 2.5rem;
  text-align: center; color: var(--color-text-muted);
  cursor: pointer; transition: all var(--transition);
  background: var(--color-bg);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ===== Size info ===== */
.size-info {
  display: flex; gap: 1.5rem; margin: 0.75rem 0; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--color-text-muted);
}
.size-info strong { color: var(--color-text); }

/* ===== QR Canvas ===== */
.qr-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.qr-controls { display: flex; flex-direction: column; }
.qr-preview-col { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.qr-canvas-wrap {
  display: flex; justify-content: center; padding: 1.5rem;
  background: #fff; border-radius: var(--radius); border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.qr-canvas-wrap canvas { max-width: 100%; height: auto; }
.qr-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.5rem; }
.qr-theme-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.5rem 0.3rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-bg); cursor: pointer; transition: all var(--transition); text-align: center;
}
.qr-theme-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }
.qr-theme-card.selected { border-color: var(--color-primary); background: var(--color-primary-light); box-shadow: var(--shadow-glow); }
.qr-theme-swatch {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qr-theme-swatch-inner { width: 16px; height: 16px; border-radius: 3px; }
.qr-theme-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text); }
.qr-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.qr-color-pick { display: flex; gap: 0.4rem; align-items: center; }
.qr-color-input {
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--color-border);
  border-radius: var(--radius-xs); cursor: pointer; background: none;
}
.qr-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.qr-color-input::-webkit-color-swatch { border-radius: 4px; border: none; }
@media (max-width: 700px) {
  .qr-layout { grid-template-columns: 1fr; }
  .qr-preview-col { position: static; }
  .qr-options-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Preview pane ===== */
.preview-pane {
  padding: 1.25rem; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: auto; min-height: 200px; line-height: 1.7;
  box-shadow: var(--shadow);
}
.preview-pane h1, .preview-pane h2, .preview-pane h3 { margin: 1em 0 0.5em; }
.preview-pane p { margin: 0.5em 0; }
.preview-pane code { background: var(--color-surface); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
.preview-pane pre { background: var(--color-surface); padding: 1em; border-radius: var(--radius-sm); overflow-x: auto; }
.preview-pane pre code { background: none; padding: 0; }
.preview-pane blockquote { border-left: 3px solid var(--color-primary); padding-left: 1em; color: var(--color-text-muted); }
.preview-pane table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.preview-pane th, .preview-pane td { border: 1px solid var(--color-border); padding: 0.5em 0.75em; text-align: left; }
.preview-pane th { background: var(--color-surface); font-weight: 600; }
.preview-pane ul, .preview-pane ol { padding-left: 1.5em; margin: 0.5em 0; }
.preview-pane li { list-style: initial; }
.preview-pane ol li { list-style: decimal; }

/* ===== Error / Success ===== */
.error-msg { color: var(--color-error); font-size: 0.85rem; margin-top: 0.5rem; font-family: var(--font-mono); }
.success-msg { color: var(--color-success); font-size: 0.85rem; margin-top: 0.5rem; }

/* ===== Image preview ===== */
.image-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem; margin: 1rem 0;
}
.image-canvas-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 1rem; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  min-height: 200px; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.image-canvas-wrap canvas { max-width: 100%; height: auto; }
.checkerboard {
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
[data-theme="dark"] .checkerboard {
  background-image: linear-gradient(45deg, #333 25%, transparent 25%),
    linear-gradient(-45deg, #333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #333 75%),
    linear-gradient(-45deg, transparent 75%, #333 75%);
}

/* ===== Security Tool Styles ===== */
.strength-meter {
  width: 100%; height: 8px; background: var(--color-border);
  border-radius: 4px; overflow: hidden; margin: 0.75rem 0;
}
.strength-meter-fill {
  height: 100%; border-radius: 4px; transition: width 0.4s ease, background 0.4s ease;
}
.strength-meter-fill.weak { background: #ea4335; }
.strength-meter-fill.fair { background: #fbbc04; }
.strength-meter-fill.good { background: #1a73e8; }
.strength-meter-fill.strong { background: #34a853; }
.security-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.75rem; border-radius: 24px; font-size: 0.8rem; font-weight: 500;
}
.security-badge.pass { background: #e6f4ea; color: #137333; }
.security-badge.warn { background: #fef7e0; color: #e37400; }
.security-badge.fail { background: #fce8e6; color: #c5221f; }
[data-theme="dark"] .security-badge.pass { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .security-badge.warn { background: rgba(253,214,99,0.12); color: #fdd663; }
[data-theme="dark"] .security-badge.fail { background: rgba(242,139,130,0.12); color: #f28b82; }
.directive-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  margin-bottom: 0.5rem; background: var(--color-bg);
}
.directive-row label { min-width: 140px; font-weight: 500; font-size: 0.9rem; }
.directive-row input[type="text"] {
  flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-xs); background: var(--color-bg); color: var(--color-text);
}
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute; inset: 0; background: var(--color-border);
  border-radius: 12px; transition: background var(--transition); cursor: pointer;
}
.toggle-switch .slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider { background: var(--color-primary); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }
.key-output {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 1rem; font-family: var(--font-mono);
  font-size: 0.8rem; line-height: 1.5; word-break: break-all;
  white-space: pre-wrap; max-height: 300px; overflow-y: auto;
}

/* ===== Slider ===== */
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 6px;
  background: var(--color-border); border-radius: 3px; outline: none;
  transition: background var(--transition);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--color-primary);
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-primary); cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ===== Toast notification ===== */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem; background: #323232;
  color: #fff; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500;
  z-index: 10000;
  opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .toast { background: var(--color-surface-2); color: var(--color-text); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Back to top ===== */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
  z-index: 99;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ===== Footer ===== */
.site-footer {
  position: relative; overflow: hidden;
  background: var(--color-bg-alt); color: var(--color-text-muted);
  padding: 3.5rem 0 1.5rem; margin-top: 4rem;
  border-top: 1px solid var(--color-border);
}
.footer-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 240px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .footer-glow {
  background: radial-gradient(ellipse, rgba(99,102,241,0.15) 0%, transparent 70%);
}
.footer-cta {
  text-align: center; padding: 3rem 2rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 3rem;
  box-shadow: var(--shadow);
}
.footer-cta::before { display: none; }
.footer-cta h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; position: relative; }
.footer-cta p { color: var(--color-text-muted); margin-bottom: 1rem; position: relative; }

.footer-content {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.footer-brand { max-width: 340px; }
.footer-tagline { color: var(--color-text-muted); font-size: 0.88rem; margin-top: 0.75rem; line-height: 1.6; }

.footer-features {
  display: flex; gap: 0.6rem; flex-wrap: wrap; padding-top: 0.25rem;
}
.footer-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem; border-radius: 99px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: 0.82rem; font-weight: 500; color: var(--color-text-muted);
  transition: all 0.2s ease;
}
.footer-pill:hover {
  border-color: var(--color-primary); color: var(--color-primary);
  background: var(--color-primary-light);
}
.footer-pill-icon { font-size: 0.9rem; line-height: 1; }

.footer-nav {
  display: flex; gap: 1.5rem; flex-shrink: 0; padding-top: 0.35rem;
}
.footer-nav a {
  color: var(--color-text-muted); font-size: 0.88rem; font-weight: 500;
  transition: color 0.2s ease; text-decoration: none;
}
.footer-nav a:hover { color: var(--color-primary); }

.footer-divider {
  height: 1px; margin: 2rem 0 1.25rem;
  background: linear-gradient(90deg, transparent, var(--color-border) 30%, var(--color-border) 70%, transparent);
}

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--color-text-light);
}
.footer-made { font-style: italic; }

/* ===== Category-colored tool cards ===== */
.tool-card--finance:hover { border-color: #34a853; box-shadow: 0 1px 3px 0 rgba(52,168,83,0.2), 0 4px 8px 3px rgba(52,168,83,0.1); }
.tool-card--health:hover { border-color: #ea4335; box-shadow: 0 1px 3px 0 rgba(234,67,53,0.2), 0 4px 8px 3px rgba(234,67,53,0.1); }
.tool-card--everyday:hover { border-color: #fbbc04; box-shadow: 0 1px 3px 0 rgba(251,188,4,0.2), 0 4px 8px 3px rgba(251,188,4,0.1); }
.tool-card--design:hover { border-color: #8430ce; box-shadow: 0 1px 3px 0 rgba(132,48,206,0.2), 0 4px 8px 3px rgba(132,48,206,0.1); }
.tool-card--seo:hover { border-color: #1a73e8; box-shadow: 0 1px 3px 0 rgba(26,115,232,0.2), 0 4px 8px 3px rgba(26,115,232,0.1); }
.tool-card--data:hover { border-color: #34a853; box-shadow: 0 1px 3px 0 rgba(52,168,83,0.2), 0 4px 8px 3px rgba(52,168,83,0.1); }
.tool-card--life:hover { border-color: #ea4335; box-shadow: 0 1px 3px 0 rgba(234,67,53,0.2), 0 4px 8px 3px rgba(234,67,53,0.1); }
.tool-card--text:hover { border-color: #1a73e8; box-shadow: 0 1px 3px 0 rgba(26,115,232,0.2), 0 4px 8px 3px rgba(26,115,232,0.1); }
.tool-card--developer:hover { border-color: #1e8e3e; box-shadow: 0 1px 3px 0 rgba(30,142,62,0.2), 0 4px 8px 3px rgba(30,142,62,0.1); }
.tool-card--converter:hover { border-color: #e37400; box-shadow: 0 1px 3px 0 rgba(227,116,0,0.2), 0 4px 8px 3px rgba(227,116,0,0.1); }
.tool-card--generator:hover { border-color: #c5221f; box-shadow: 0 1px 3px 0 rgba(197,34,31,0.2), 0 4px 8px 3px rgba(197,34,31,0.1); }
.tool-card--image:hover { border-color: #4a3cb5; box-shadow: 0 1px 3px 0 rgba(74,60,181,0.2), 0 4px 8px 3px rgba(74,60,181,0.1); }

/* ===== Enhanced form components ===== */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.form-group {
  display: flex; flex-direction: column; gap: 0.35rem;
}
.form-group label {
  font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text); outline: none;
  font-size: 0.9rem; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.12);
}

/* ===== Result cards ===== */
.result-card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1.75rem; margin: 1rem 0;
  text-align: center; position: relative;
  box-shadow: var(--shadow);
}
.result-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--color-primary); border-radius: var(--radius) var(--radius) 0 0;
}
.result-card .result-value {
  font-size: 2.5rem; font-weight: 700; color: var(--color-primary);
  line-height: 1.2; margin-bottom: 0.25rem;
}
.result-card .result-label {
  font-size: 0.85rem; color: var(--color-text-muted); text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Data tables ===== */
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.88rem; }
.data-table th {
  text-align: left; padding: 0.75rem 1rem; background: var(--color-surface);
  font-weight: 600; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.data-table tr:hover td { background: var(--color-surface); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; margin: 1rem 0;
  box-shadow: var(--shadow);
}

/* ===== Tabs ===== */
.tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.25rem; overflow-x: auto;
}
.tab-btn {
  padding: 0.65rem 1.25rem; background: none; border: none;
  font-size: 0.88rem; font-weight: 500; color: var(--color-text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active {
  color: var(--color-primary); border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Gauge / Progress ===== */
.gauge-container {
  display: flex; align-items: center; gap: 1rem; margin: 1rem 0;
}
.gauge-bar {
  flex: 1; height: 12px; background: var(--color-border);
  border-radius: 6px; overflow: hidden; position: relative;
}
.gauge-fill {
  height: 100%; border-radius: 6px; transition: width 0.5s ease, background 0.3s;
}
.gauge-label {
  font-size: 0.85rem; font-weight: 700; min-width: 45px; text-align: right;
  color: var(--color-text);
}

/* ===== Chip / Tag ===== */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.75rem; border-radius: 24px; font-size: 0.8rem; font-weight: 500;
  background: var(--color-surface); color: var(--color-text-muted);
  border: none;
}
.chip--primary { background: var(--color-primary-light); color: var(--color-primary); }
.chip--success { background: #e6f4ea; color: #137333; }
.chip--warning { background: #fef7e0; color: #e37400; }
.chip--error { background: #fce8e6; color: #c5221f; }
[data-theme="dark"] .chip--success { background: rgba(129,201,149,0.12); color: #81c995; }
[data-theme="dark"] .chip--warning { background: rgba(253,214,99,0.12); color: #fdd663; }
[data-theme="dark"] .chip--error { background: rgba(242,139,130,0.12); color: #f28b82; }

/* ===== Calculator grid ===== */
.calc-display {
  width: 100%; padding: 1.25rem 1rem; text-align: right;
  font-family: var(--font-mono); font-size: 2rem; font-weight: 700;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); color: var(--color-text); margin-bottom: 0.75rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
}
.calc-btn {
  padding: 0.85rem; border: none;
  border-radius: var(--radius-sm); font-size: 1.05rem; font-weight: 500;
  background: var(--color-surface); color: var(--color-text);
  cursor: pointer; transition: all var(--transition);
}
.calc-btn:hover { background: var(--color-surface-2); box-shadow: var(--shadow); }
.calc-btn:active { transform: scale(0.96); }
.calc-btn--op {
  background: var(--color-primary-light); color: var(--color-primary);
}
.calc-btn--op:hover { background: var(--color-primary); color: #fff; }
.calc-btn--eq {
  background: var(--color-primary); color: #fff;
  grid-column: span 2;
}
.calc-btn--eq:hover { background: var(--color-primary-hover); }
.calc-btn--wide { grid-column: span 2; }
.calc-btn--fn {
  font-size: 0.85rem; background: var(--color-surface); color: var(--color-text-muted);
}
.calc-btn--fn:hover { color: var(--color-primary); }

/* ===== Timer / Clock display ===== */
.timer-display {
  text-align: center; padding: 2rem;
  font-family: var(--font-mono); font-size: 3.5rem; font-weight: 700;
  color: var(--color-text); letter-spacing: 0.05em;
  background: var(--color-surface); border-radius: var(--radius);
  border: 1px solid var(--color-border); margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.timer-controls {
  display: flex; justify-content: center; gap: 0.75rem; margin: 1rem 0;
}

/* ===== Circular progress (for pomodoro etc) ===== */
.circular-progress {
  width: 220px; height: 220px; margin: 1rem auto;
  position: relative;
}
.circular-progress svg { transform: rotate(-90deg); }
.circular-progress .progress-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}
.circular-progress .progress-time {
  font-size: 2.5rem; font-weight: 700; line-height: 1;
}
.circular-progress .progress-label {
  font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem;
}

/* ===== Lap / Log list ===== */
.lap-list {
  max-height: 300px; overflow-y: auto; margin: 1rem 0;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lap-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1rem; border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem; font-family: var(--font-mono);
}
.lap-item:last-child { border-bottom: none; }
.lap-item:hover { background: var(--color-surface); }
.lap-number { font-weight: 700; color: var(--color-text-muted); }

/* ===== Color swatch ===== */
.color-swatch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem; margin: 1rem 0;
}
.color-swatch {
  aspect-ratio: 1; border-radius: var(--radius);
  border: 1px solid var(--color-border); cursor: pointer;
  transition: all var(--transition); position: relative;
  box-shadow: var(--shadow);
}
.color-swatch:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }
.color-swatch-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0.2rem; text-align: center; font-size: 0.65rem;
  font-family: var(--font-mono); background: rgba(0,0,0,0.6); color: #fff;
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

/* ===== Live preview ===== */
.live-preview {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 2rem; min-height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); margin: 1rem 0;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.live-preview-label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: 0.5rem;
}

/* ===== Slider group ===== */
.slider-group {
  display: flex; flex-direction: column; gap: 0.25rem; margin: 0.75rem 0;
}
.slider-header {
  display: flex; justify-content: space-between; align-items: center;
}
.slider-label {
  font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.slider-value {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  color: var(--color-primary); min-width: 50px; text-align: right;
}

/* ===== Emoji grid ===== */
.emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px; max-height: 400px; overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0.5rem;
}
.emoji-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; padding: 0.4rem; border-radius: 50%;
  cursor: pointer; transition: all var(--transition);
}
.emoji-cell:hover { background: var(--color-primary-light); transform: scale(1.15); }

/* ===== Typing test ===== */
.typing-text {
  font-size: 1.15rem; line-height: 1.8; padding: 1.25rem;
  background: var(--color-surface); border-radius: var(--radius);
  border: 1px solid var(--color-border); margin-bottom: 1rem;
  font-family: var(--font-mono);
}
.typing-text .correct { color: var(--color-success); }
.typing-text .incorrect { color: var(--color-error); background: rgba(234,67,53,0.1); border-radius: 2px; }
.typing-text .current { border-bottom: 2px solid var(--color-primary); }
.typing-text .pending { color: var(--color-text-muted); }

/* ===== Invoice ===== */
.invoice-preview {
  background: #fff; color: #202124; padding: 2.5rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  max-width: 800px; margin: 1rem auto;
  box-shadow: var(--shadow);
}
@media print {
  .site-header, .site-footer, .breadcrumbs, .tool-header,
  .tool-share, .tool-section, .back-to-top, .toast,
  .tool-actions, .no-print { display: none !important; }
  .tool-workspace { border: none; box-shadow: none; padding: 0; background: none; }
  .invoice-preview { border: none; box-shadow: none; }
}

/* ===== Morse code ===== */
.morse-ref {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.35rem; margin: 1rem 0;
}
.morse-ref-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; font-size: 0.8rem;
  background: var(--color-surface); border-radius: var(--radius-xs);
  border: none;
}
.morse-ref-char { font-weight: 700; min-width: 16px; text-align: center; }
.morse-ref-code { font-family: var(--font-mono); color: var(--color-text-muted); font-size: 0.75rem; }

/* ===== Case converter ===== */
.case-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1rem 0;
}
.case-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.75rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); cursor: pointer; font-size: 0.8rem; font-weight: 500;
  transition: all var(--transition);
}
.case-btn:hover {
  border-color: var(--color-primary); background: var(--color-bg);
  box-shadow: var(--shadow);
}
.case-btn:active { transform: scale(0.97); }
.case-icon {
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700;
  color: var(--color-primary); line-height: 1;
}
.case-result {
  overflow: hidden; word-break: break-word; font-size: 1rem;
  min-height: 4rem; padding: 1.2rem 1rem; line-height: 1.6;
}
@media (max-width: 480px) {
  .case-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Habit tracker heatmap ===== */
.heatmap-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  margin: 1rem 0;
}
.heatmap-cell {
  aspect-ratio: 1; border-radius: 3px; cursor: pointer;
  transition: all var(--transition); border: 1px solid transparent;
  min-width: 14px;
}
.heatmap-cell:hover { border-color: var(--color-primary); transform: scale(1.2); }
.heatmap-cell.level-0 { background: var(--color-surface); }
.heatmap-cell.level-1 { background: #a8dab5; }
.heatmap-cell.level-2 { background: #34a853; }
.heatmap-cell.level-3 { background: #1e8e3e; }
.heatmap-cell.level-4 { background: #137333; }
[data-theme="dark"] .heatmap-cell.level-0 { background: var(--color-surface); }
[data-theme="dark"] .heatmap-cell.level-1 { background: #0d652d; }
[data-theme="dark"] .heatmap-cell.level-2 { background: #137333; }
[data-theme="dark"] .heatmap-cell.level-3 { background: #1e8e3e; }
[data-theme="dark"] .heatmap-cell.level-4 { background: #34a853; }

/* ===== Spin wheel ===== */
.wheel-container {
  display: flex; flex-direction: column; align-items: center;
  margin: 1.5rem 0; position: relative;
}
.wheel-pointer {
  width: 0; height: 0;
  border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 20px solid var(--color-primary);
  z-index: 2; margin-bottom: -4px;
}

/* ===== Movie card ===== */
.movie-card {
  display: flex; gap: 1rem; padding: 1rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  margin-bottom: 0.75rem; transition: all var(--transition);
  background: var(--color-bg);
}
.movie-card:hover { box-shadow: var(--shadow-md); }
.movie-poster {
  width: 60px; height: 85px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.movie-info { flex: 1; min-width: 0; }
.movie-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.15rem; }
.movie-year { font-size: 0.82rem; color: var(--color-text-muted); }
.movie-desc { font-size: 0.84rem; color: var(--color-text-muted); margin-top: 0.35rem; line-height: 1.5; }
.match-badge {
  display: inline-flex; align-items: center; padding: 0.15rem 0.5rem;
  border-radius: 24px; font-size: 0.75rem; font-weight: 600;
  background: var(--color-primary-light); color: var(--color-primary);
}

/* ===== Activity card ===== */
.activity-card {
  text-align: center; padding: 2rem;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); margin: 1rem 0;
  transition: all 0.4s ease;
  box-shadow: var(--shadow);
}
.activity-card .activity-icon { font-size: 3rem; margin-bottom: 1rem; }
.activity-card .activity-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.activity-card .activity-desc { color: var(--color-text-muted); line-height: 1.7; max-width: 500px; margin: 0 auto; }
.activity-meta { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ===== Sleep timeline ===== */
.sleep-timeline {
  display: flex; height: 40px; border-radius: var(--radius);
  overflow: hidden; margin: 1rem 0; border: 1px solid var(--color-border);
}
.sleep-cycle {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff; transition: all var(--transition);
}
.sleep-cycle:nth-child(odd) { background: #1a73e8; }
.sleep-cycle:nth-child(even) { background: #4285f4; }

/* ===== Mood calendar ===== */
.mood-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin: 1rem 0;
}
.mood-day {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--color-border); transition: all var(--transition);
  background: var(--color-bg);
}
.mood-day:hover { border-color: var(--color-primary); transform: scale(1.05); box-shadow: var(--shadow); }
.mood-day.empty { background: transparent; border-color: transparent; cursor: default; box-shadow: none; }
.mood-day.today { border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.mood-great { background: #e6f4ea !important; }
.mood-good { background: #e8f0fe !important; }
.mood-okay { background: #fef7e0 !important; }
.mood-bad { background: #fce8e6 !important; }
.mood-terrible { background: #fce8e6 !important; }
[data-theme="dark"] .mood-great { background: rgba(129,201,149,0.15) !important; }
[data-theme="dark"] .mood-good { background: rgba(138,180,248,0.15) !important; }
[data-theme="dark"] .mood-okay { background: rgba(253,214,99,0.12) !important; }
[data-theme="dark"] .mood-bad { background: rgba(242,139,130,0.15) !important; }
[data-theme="dark"] .mood-terrible { background: rgba(242,139,130,0.15) !important; }

/* ===== Planner timeline ===== */
.planner-timeline {
  position: relative; margin: 1rem 0;
  border-left: 3px solid var(--color-border); padding-left: 1.5rem;
}
.time-block {
  position: relative; padding: 0.75rem 1rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  margin-bottom: 0.5rem; cursor: pointer; transition: all var(--transition);
  background: var(--color-bg);
}
.time-block:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }
.time-block::before {
  content: ''; position: absolute; left: -1.85rem; top: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-primary); transform: translateY(-50%);
}
.time-block-time { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); }
.time-block-title { font-weight: 500; }

/* ===== Packing list ===== */
.packing-category {
  margin-bottom: 1.25rem;
}
.packing-category-title {
  font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border); margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.packing-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; font-size: 0.9rem;
}
.packing-item input[type="checkbox"] { accent-color: var(--color-primary); }
.packing-item.checked { text-decoration: line-through; color: var(--color-text-muted); }

/* ===== Name card ===== */
.name-card {
  padding: 1rem; border: 1px solid var(--color-border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition); background: var(--color-bg);
}
.name-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.name-card .name-text { font-size: 1.15rem; font-weight: 600; }
.name-card .name-meaning { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.name-card .name-origin { font-size: 0.75rem; margin-top: 0.35rem; }

/* ===== Nav scroll indicator ===== */
.nav-scroll-indicator {
  display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.5rem 0;
  scrollbar-width: none; -ms-overflow-style: none;
}
.nav-scroll-indicator::-webkit-scrollbar { display: none; }

/* ===== Responsive ===== */

/* -- Tablet & small desktop (768px) -- */
@media (max-width: 768px) {
  /* Container */
  .container { padding: 0 1rem; }
  .site-main { padding: 1.5rem 0 2rem; }

  /* Header / Nav */
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 10px 16px;
    z-index: 100;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }
  [data-theme="dark"] .main-nav { background: var(--color-bg); }
  .main-nav.open { display: flex; }
  .mobile-menu-btn { display: flex; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-trigger { width: 100%; text-align: left; }
  .nav-dropdown-menu {
    position: static; width: 100%; box-shadow: none;
    border: none; background: transparent; padding: 0; border-radius: 0; display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown-grid { grid-template-columns: 1fr 1fr; gap: 2px; }
  .nav-dd-link { padding: 8px 10px; font-size: 0.82rem; }

  /* Hide sync button text on tablet */
  .sync-google-btn { padding: 7px 10px; font-size: 0; gap: 0; min-width: 0; }
  .sync-google-btn .sync-google-icon { font-size: inherit; }
  .sync-google-btn svg { width: 18px; height: 18px; }

  /* Hero */
  .hero { padding: 3rem 1.5rem 2rem; margin: -1.5rem -1rem 2rem; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 0.92rem; }
  .hero-search-wrap { max-width: 100%; }
  .hero-stats { gap: 1.25rem; }
  .hero-stat-num { font-size: 1.25rem; }
  .hero-stat-sep { height: 24px; }

  /* Tool page */
  .tool-header h1 { font-size: 1.6rem; }
  .tool-tagline { font-size: 0.92rem; }
  .tool-workspace { padding: 1.25rem 1rem; }
  .tool-section h2 { font-size: 1.15rem; }
  .tool-share { flex-wrap: wrap; }
  .tool-split { grid-template-columns: 1fr; }

  /* Grids */
  .tools-grid { grid-template-columns: 1fr; }
  .tools-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer-content { flex-direction: column; gap: 1.25rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .category-header { flex-wrap: wrap; }

  /* Input layouts */
  .input-row { gap: 0.75rem; }
  .input-group { flex-wrap: wrap; }
  .directive-row { flex-wrap: wrap; gap: 0.5rem; }
  .directive-row label { min-width: 100%; }

  /* Data table horizontal scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* -- Mobile (480px) -- */
@media (max-width: 480px) {
  /* Container */
  .container { padding: 0 0.75rem; }

  /* Hero */
  .hero { padding: 2rem 1rem 1.5rem; margin: -1.5rem -0.75rem 1.5rem; }
  .hero h1 { font-size: 1.65rem; line-height: 1.2; }
  .hero-sub { font-size: 0.85rem; margin-bottom: 1.5rem; }
  .hero-stat-sep { display: none; }
  .hero-stats { gap: 0.75rem; }
  .hero-stat-num { font-size: 1.15rem; }

  /* Header actions */
  .cmdk-trigger { min-width: 0; padding: 0.35rem 0.5rem; }
  .cmdk-trigger-text { display: none; }
  .cmdk-trigger-kbd { display: none; }
  .logo { margin-right: 0.75rem; }
  .logo { font-size: 1rem; }

  /* Tool page */
  .tool-header { margin-bottom: 1rem; }
  .tool-header h1 { font-size: 1.35rem; }
  .tool-tagline { font-size: 0.85rem; }
  .tool-workspace { padding: 1rem 0.75rem; border-radius: 10px; }
  .breadcrumbs { font-size: 0.78rem; margin-bottom: 1rem; }
  .tool-section { margin-bottom: 1.5rem; }
  .how-to-list li { padding-left: 2.2rem; font-size: 0.88rem; }
  .faq-item summary { padding: 0.85rem 1rem; font-size: 0.9rem; }
  .faq-item p { padding: 0 1rem 0.85rem; font-size: 0.88rem; }

  /* Footer */
  .footer-features { gap: 0.4rem; }
  .footer-pill { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
  .footer-cta { padding: 2rem 1rem; }
  .footer-cta h2 { font-size: 1.3rem; }
  .site-footer { padding: 2rem 0 1.25rem; margin-top: 2rem; }

  /* Tool grids */
  .tools-grid-sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tool-card { padding: 0.7rem 0.85rem; gap: 0.65rem; }
  .tool-card-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .tool-card-name { font-size: 0.85rem; }
  .tool-card-desc { font-size: 0.75rem; }
  .tool-card-arrow { display: none; }

  /* Components */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .timer-display { font-size: 2rem; padding: 1.25rem; }
  .calc-grid { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
  .calc-btn { padding: 0.65rem; font-size: 0.9rem; }
  .circular-progress { width: 180px; height: 180px; }
  .circular-progress .progress-time { font-size: 2rem; }
  .result-card .result-value { font-size: 2rem; }
  .result-card { padding: 1.25rem; }

  /* Buttons */
  .btn { padding: 0.5rem 1rem; font-size: 0.82rem; }
  .tool-actions { gap: 0.35rem; }

  /* Share */
  .tool-share { gap: 0.35rem; font-size: 0.82rem; }
  .share-btn { width: 32px; height: 32px; font-size: 0.75rem; }

  /* Command palette */
  .cmdk-overlay { padding-top: 0; align-items: flex-start; }
  .cmdk-modal { max-width: 100%; max-height: 100vh; border-radius: 0; border: none; }

  /* Misc */
  .input-field { min-width: 100%; }
  .option-group { gap: 0.5rem; }
  .tab-bar { gap: 0; }
  .tab-btn { padding: 0.55rem 0.85rem; font-size: 0.82rem; }
  .ct-display-wrap { width: 200px; height: 200px; }
  .ct-time { font-size: 2.2rem; }
  .ct-inputs { flex-wrap: wrap; justify-content: center; }
  .ct-input { width: 56px; font-size: 1.1rem; }
  .ct-presets { gap: 0.3rem; }
  .ct-preset { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
}


/* ===== Button Group & Toggle Group ===== */
.btn-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
}
.btn-group .btn,
.btn-group .btn-sm {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--color-border);
}
.btn-group .btn:last-child,
.btn-group .btn-sm:last-child {
  border-right: none;
}
.btn-group .btn.active,
.btn-group .btn-sm.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ===== Toggle Group (Metric/Imperial etc.) ===== */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--color-surface);
}
.toggle-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.toggle-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}
.toggle-btn:hover:not(.active) {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ===== CSV Viewer Table ===== */
#tableContainer {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
#tableContainer::-webkit-scrollbar { width: 6px; height: 6px; }
#tableContainer::-webkit-scrollbar-track { background: transparent; }
#tableContainer::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
#tableContainer::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
#tableContainer::-webkit-scrollbar-corner { background: transparent; }
.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: fixed;
}
.csv-table th,
.csv-table td {
  border: 1px solid var(--color-border);
  padding: 0;
  position: relative;
}
.csv-table thead th {
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.csv-th-inner {
  display: flex;
  align-items: center;
  gap: 2px;
}
.csv-col-resize {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 3;
  user-select: none;
}
.csv-col-resize:hover,
.csv-col-resize.active {
  background: var(--color-primary);
  opacity: 0.4;
}
.csv-edit {
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--color-text);
  outline: none;
  min-width: 60px;
  box-sizing: border-box;
}
.csv-edit:focus {
  background: var(--color-primary-light);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}
.csv-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
[data-theme="dark"] .csv-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
.csv-edit-header {
  font-weight: 600;
}
.csv-sort {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  flex-shrink: 0;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  border-radius: 4px;
  line-height: 1;
}
.csv-sort:hover {
  opacity: 1;
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.csv-sort-active {
  opacity: 1;
  color: var(--color-primary);
}
.csv-del-row {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  flex-shrink: 0;
  line-height: 1;
}
.csv-row-num:hover .csv-del-row {
  opacity: 0.6;
}
.csv-del-row:hover {
  opacity: 1 !important;
  color: var(--color-error);
}
/* Column selection */
td.csv-col-selected,
th.csv-col-selected {
  background: rgba(99,102,241,0.08) !important;
}
th.csv-col-selected {
  background: rgba(99,102,241,0.15) !important;
}
td.csv-col-selected { border-left-color: var(--color-primary); border-right-color: var(--color-primary); }
th.csv-col-selected { border-color: var(--color-primary); }
/* First and last selected cells get top/bottom borders */
tbody tr:last-child td.csv-col-selected { border-bottom-color: var(--color-primary); }
[data-theme="dark"] td.csv-col-selected,
[data-theme="dark"] th.csv-col-selected { background: rgba(129,140,248,0.12) !important; }
[data-theme="dark"] th.csv-col-selected { background: rgba(129,140,248,0.2) !important; }
/* Column toolbar */
#viewSection { position: relative; }
.csv-col-toolbar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 10;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}
[data-theme="dark"] .csv-col-toolbar { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.csv-col-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s;
}
.csv-col-toolbar-btn:hover { background: var(--color-surface); }
.csv-col-toolbar-btn.csv-col-delete { color: var(--color-error); }
.csv-col-toolbar-btn.csv-col-delete:hover { background: rgba(239,68,68,0.1); }
.csv-row-num {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 2px 6px;
  width: 60px;
  min-width: 60px;
  background: var(--color-surface);
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  position: relative;
}
.csv-del-row {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}
.csv-table tbody tr:hover td {
  background: var(--color-surface);
}
.csv-table tbody tr:hover .csv-row-num {
  background: var(--color-surface-2);
}

/* CSV Popup Modal */
.csv-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1000;
  display: flex; align-items: stretch; justify-content: center;
  padding: 1.5vh 1vw;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.csv-popup-overlay.open { opacity: 1; pointer-events: auto; }
.csv-popup {
  width: 100%; max-width: 1600px;
  background: var(--color-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: scale(0.97); transition: transform 0.2s;
  overflow: hidden;
}
.csv-popup-overlay.open .csv-popup { transform: scale(1); }
.csv-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1rem; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface); gap: 0.5rem; flex-shrink: 0;
}
.csv-popup-title { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.csv-popup-title h3 { margin: 0; font-size: 0.95rem; white-space: nowrap; }
.csv-popup-stats {
  font-size: 0.78rem; color: var(--color-text-muted); white-space: nowrap;
  background: var(--color-bg); padding: 2px 10px; border-radius: 24px;
  border: none;
}
.csv-popup-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.csv-popup-search {
  padding: 0.35rem 0.65rem; border: 1px solid var(--color-border);
  border-radius: 24px; background: var(--color-bg);
  color: var(--color-text); font-size: 0.82rem; width: 200px;
}
.csv-popup-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }
.csv-popup-search::placeholder { color: var(--color-text-muted); }
.csv-popup-sep { width: 1px; height: 20px; background: var(--color-border); flex-shrink: 0; }
.csv-popup-close {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--color-text-muted); line-height: 1; padding: 4px 8px;
  border-radius: 50%; transition: background var(--transition), color var(--transition);
}
.csv-popup-close:hover { color: var(--color-error); background: rgba(234,67,53,0.08); }
.csv-popup-body { flex: 1; overflow: auto; }
.csv-popup-body .csv-table { margin: 0; }
.csv-popup-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem; border-top: 1px solid var(--color-border);
  background: var(--color-surface); font-size: 0.78rem; color: var(--color-text-muted);
  flex-shrink: 0; gap: 1rem;
}
.csv-popup-footer-hint { opacity: 0.7; }
@media (max-width: 768px) {
  .csv-popup-overlay { padding: 0; }
  .csv-popup { border-radius: 0; max-width: 100%; }
  .csv-popup-search { width: 120px; }
}

/* CSV Related Tools */
.csv-related-tools {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
}
.csv-related-link {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; border: 1px solid var(--color-border);
  border-radius: 24px; background: var(--color-bg);
  color: var(--color-text); font-size: 0.85rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
}
.csv-related-link:hover {
  border-color: var(--color-primary); color: var(--color-primary);
  text-decoration: none; box-shadow: var(--shadow);
}
.csv-related-icon { font-size: 1.1rem; }

/* ===== Invoice Generator ===== */
.inv-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
  background: var(--color-bg);
  border-radius: 0;
  padding: 0;
}
.inv-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.7rem 0.5rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.02em;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}
.inv-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--color-primary);
  transition: width 0.2s ease;
}
.inv-tab:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-primary) 5%, transparent); }
.inv-tab.active {
  color: var(--color-primary);
  font-weight: 600;
  background: none;
  box-shadow: none;
}
.inv-tab.active::after { width: 60%; }
.inv-tab-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.inv-tab.active .inv-tab-icon { opacity: 1; }
.inv-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.inv-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}
/* Profile Cards */
.inv-profile-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.75rem;
}
.inv-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--color-bg);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-width: 0;
}
.inv-profile-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
}
.inv-profile-card--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.inv-profile-card--add {
  border-style: dashed;
  opacity: 0.7;
  justify-content: center;
}
.inv-profile-card--add:hover {
  opacity: 1;
}
.inv-profile-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}
.inv-profile-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.inv-profile-card--add .inv-profile-card-avatar {
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 1.2rem;
}
.inv-profile-card-info {
  flex: 1;
  min-width: 0;
}
.inv-profile-card-name {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-profile-card-detail {
  font-size: 0.73rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.inv-profile-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.inv-profile-card:hover .inv-profile-card-actions {
  opacity: 1;
}
.inv-profile-card-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  padding: 0;
  transition: all var(--transition);
}
.inv-profile-card-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}
.inv-profile-card-btn--del:hover {
  color: var(--color-error);
  border-color: var(--color-error);
  background: rgba(234,67,53,0.06);
}
.inv-from-cancel-btn {
  margin-top: 0.75rem;
  float: right;
}
.inv-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.inv-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}
.inv-logo-dropzone {
  position: relative;
  width: 100%;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.inv-logo-dropzone:hover,
.inv-logo-dropzone.inv-logo-dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.inv-logo-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.inv-logo-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 1.25rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.inv-logo-drop-content svg {
  opacity: 0.5;
}
.inv-logo-hint {
  font-size: 0.7rem;
  opacity: 0.6;
}
.inv-logo-preview-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}
.inv-logo-preview-wrap img {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.inv-logo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  z-index: 2;
  transition: all var(--transition);
}
.inv-logo-remove:hover {
  color: var(--color-error);
  border-color: var(--color-error);
}

/* Customer Dropdown */
.inv-customer-select-wrap { position: relative; margin-bottom: 0.75rem; }
.inv-customer-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color var(--transition);
  min-height: 40px;
}
.inv-customer-select:hover { border-color: var(--color-primary); }
.inv-customer-select-name { font-weight: 500; }
.inv-customer-select-hint { color: var(--color-text-muted); }
.inv-customer-select-chevron {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 8px;
}
.inv-customer-select-wrap.open .inv-customer-select-chevron { transform: rotate(180deg); }
.inv-customer-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.inv-customer-select-wrap.open .inv-customer-dropdown { display: block; }
.inv-customer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--color-border);
}
.inv-customer-item:last-child { border-bottom: none; }
.inv-customer-item:hover { background: var(--color-surface); }
.inv-customer-item--active { background: var(--color-primary-light); }
.inv-customer-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.inv-customer-item-info { flex: 1; min-width: 0; }
.inv-customer-item-name { font-weight: 500; font-size: 0.84rem; }
.inv-customer-item-detail { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-customer-item-edit {
  background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 4px; border-radius: 50%; opacity: 0; transition: opacity var(--transition);
  flex-shrink: 0;
}
.inv-customer-item:hover .inv-customer-item-edit { opacity: 1; }
.inv-customer-item-edit:hover { color: var(--color-primary); }
.inv-customer-item--add {
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  gap: 6px;
}
.inv-customer-item--add:hover { color: var(--color-primary); }

/* Customers Tab */
.inv-customers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.inv-customer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inv-customer-list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.inv-customer-list-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.inv-customer-list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.inv-customer-list-info { flex: 1; min-width: 0; }
.inv-customer-list-name { font-weight: 500; font-size: 0.95rem; }
.inv-customer-list-detail { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 2px; }
.inv-customer-list-meta { text-align: right; flex-shrink: 0; }
.inv-customer-list-count { font-weight: 700; font-size: 0.95rem; }
.inv-customer-list-label { font-size: 0.72rem; color: var(--color-text-muted); }
.inv-customer-list-actions { display: flex; gap: 4px; flex-shrink: 0; }
.inv-customer-list-delete {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 4px;
}
.inv-customer-list-card:hover .inv-customer-list-delete { opacity: 1; }
.inv-customer-list-delete:hover {
  color: var(--color-error);
  background: rgba(234, 67, 53, 0.08);
}
.inv-customer-view-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--color-text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  background: none;
  border: none;
  padding: 4px 0;
}
.inv-customer-view-back:hover { color: var(--color-primary); }
.inv-customer-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}
.inv-customer-view-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.inv-customer-view-name { font-weight: 600; font-size: 1.1rem; }
.inv-customer-view-detail { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 2px; }
.inv-customer-view-actions { margin-left: auto; display: flex; gap: 6px; }

.inv-field { margin-bottom: 0.35rem; }
.inv-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--color-text-muted);
}
.inv-field .tool-input, .inv-details-grid .tool-input {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
}
.inv-field textarea.tool-input {
  padding: 0.4rem 0.65rem;
  min-height: unset;
}
.inv-items-wrap { overflow-x: auto; }
.inv-items-table {
  width: 100%;
  border-collapse: collapse;
}
.inv-items-table th {
  text-align: left;
  padding: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.inv-items-table td {
  padding: 4px;
  border-bottom: 1px solid var(--color-border);
}
.inv-items-table .tool-input {
  padding: 6px 8px;
  font-size: 0.84rem;
}
.inv-del-row {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all var(--transition);
  line-height: 1;
}
.inv-del-row:hover {
  color: var(--color-error);
  background: rgba(234,67,53,0.08);
}
.inv-totals {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.inv-totals-row {
  display: flex;
  justify-content: space-between;
  width: 220px;
  font-size: 0.88rem;
}
.inv-totals-row span { color: var(--color-text-muted); }
.inv-totals-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 2px solid var(--color-border);
  font-size: 1.1rem;
}
.inv-totals-total span { color: var(--color-text); }
.inv-totals-total strong { color: var(--color-primary); }

.inv-action-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
.inv-act-spacer { flex: 1; }
.inv-act-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.78rem; font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.inv-act-btn svg { flex-shrink: 0; opacity: 0.7; }
.inv-act-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow);
}
.inv-act-btn:hover svg { opacity: 1; }
.inv-act-btn:active { transform: scale(0.97); }
.inv-act-btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(26,115,232,0.3);
}
.inv-act-btn--primary svg { opacity: 1; }
.inv-act-btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(26,115,232,0.4);
}

/* Template picker */
.inv-modal--wide { max-width: 680px; }
.inv-tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.inv-tpl-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  background: #fff;
  overflow: hidden;
  transition: all var(--transition);
}
.inv-tpl-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.inv-tpl-card.active {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}
.inv-tpl-card.active::after {
  content: '\2713';
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.inv-tpl-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  padding: 10px;
  display: flex;
  flex-direction: column;
  font-size: 5px;
  line-height: 1.4;
  color: #5f6368;
  overflow: hidden;
  pointer-events: none;
}
.inv-tpl-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 4px 8px;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
@media (max-width: 560px) {
  .inv-tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .inv-modal--wide { max-width: 400px; }
}
@media (max-width: 380px) {
  .inv-act-btn span { display: none; }
  .inv-act-btn { padding: 7px 9px; }
}
/* Invoice fullpage layout */
.inv-fullpage {
  display: flex; flex-direction: column; height: 100%;
}
.inv-fullpage .inv-tabs {
  flex-shrink: 0;
  padding: 0.25rem 0 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: none;
  margin-bottom: 0;
}
.inv-fullpage .inv-panel { flex: 1; overflow-y: auto; padding: 1rem; display: none; }
.inv-fullpage .inv-panel:has(.inv-view-page) { overflow-y: visible; overflow: visible; }
.inv-fullpage .inv-panel.active { display: flex; flex-direction: column; }
.inv-fullpage .inv-editor-split.active { flex-direction: row; }
.inv-fullpage .inv-editor-split.active { display: flex; }

/* Editor split: form left, preview right */
.inv-editor-split {
  gap: 0; flex: 1; overflow: hidden;
}
.inv-editor-split.active { display: flex !important; }
.inv-editor-form {
  flex: 1; min-width: 0; overflow-y: auto; padding: 1rem 1.25rem;
  border-right: 1px solid var(--color-border);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.inv-editor-form::-webkit-scrollbar { width: 6px; }
.inv-editor-form::-webkit-scrollbar-track { background: transparent; }
.inv-editor-form::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
.inv-editor-form::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
.inv-editor-preview {
  width: 50%; min-width: 380px; overflow-y: auto;
  background: var(--color-surface); padding: 1rem;
  display: flex; flex-direction: column;
}
.inv-preview {
  background: #fff;
  color: #333;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1; min-height: 0;
}

/* Other tabs (saved, customers, stats) get padding and scroll */
.inv-fullpage #panelSaved,
.inv-fullpage #panelCustomers,
.inv-fullpage #panelStats {
  padding: 1.5rem 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}
.inv-fullpage #panelSaved {
  display: none;
  flex-direction: column;
}
.inv-fullpage #panelSaved.active {
  display: flex;
}
#savedInvoicesList {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .inv-editor-split { flex-direction: column; }
  .inv-editor-form { border-right: none; border-bottom: 1px solid var(--color-border); overflow-y: auto; }
  .inv-editor-preview { width: 100%; min-width: 0; }
}
@media (max-width: 480px) {
  .inv-editor-form { padding: 0.75rem; }
  .inv-editor-preview { padding: 0.75rem; }
  .inv-preview { padding: 1.25rem; }
}

/* Notes Modal */
.inv-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.inv-modal {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}
.inv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.inv-modal-title {
  font-weight: 600;
  font-size: 1rem;
}
.inv-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: 50%;
  line-height: 1;
}
.inv-modal-close:hover {
  color: var(--color-text);
  background: var(--color-surface);
}
.inv-modal textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
}
.inv-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Saved invoices */
.inv-saved-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.inv-saved-toolbar .tool-input {
  height: 40px;
}
.inv-saved-toolbar .tool-input[type="text"] {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

/* Empty state */
.inv-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  text-align: center;
  gap: 0.5rem;
}
#customersListView {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#savedInvoicesList:empty {
  display: none;
}
.inv-empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0.5rem;
}
.inv-empty-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 300px;
  line-height: 1.5;
}

/* View invoice page */
.inv-view-page {
  display: flex;
  flex-direction: column;
}
.inv-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}
.inv-view-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inv-view-preview {
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.inv-view-preview .inv-preview {
  border-radius: var(--radius);
  flex: 1;
}
.inv-preview-a4 {
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 2.5rem;
  box-sizing: border-box;
}
.inv-saved-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inv-saved-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: all var(--transition);
}
.inv-saved-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.inv-saved-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.inv-saved-number { font-weight: 600; font-size: 0.95rem; }
.inv-saved-client { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 2px; }
.inv-saved-amount { font-weight: 700; font-size: 1.05rem; }
.inv-status {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 24px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.inv-status-paid { background: rgba(52,168,83,0.12); color: var(--color-success); }
.inv-status-unpaid { background: rgba(251,188,4,0.15); color: #e37400; }
.inv-saved-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}
.inv-saved-date { font-size: 0.78rem; color: var(--color-text-muted); }
.inv-saved-actions { display: flex; gap: 6px; }

/* Stats */
.inv-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.inv-stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.inv-stat-card--primary { border-color: var(--color-primary); background: var(--color-primary-light); }
.inv-stat-card--success { border-color: var(--color-success); }
.inv-stat-card--warning { border-color: var(--color-warning); }
.inv-stat-value { font-size: 1.5rem; font-weight: 700; }
.inv-stat-card--primary .inv-stat-value { color: var(--color-primary); }
.inv-stat-card--success .inv-stat-value { color: var(--color-success); }
.inv-stat-card--warning .inv-stat-value { color: #e37400; }
.inv-stat-label { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; font-weight: 500; }

.inv-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.inv-chart-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.inv-chart-bar--paid { background: var(--color-success); }
.inv-chart-bar--unpaid { background: var(--color-warning); }
.inv-chart-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  white-space: nowrap;
}
.inv-payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.84rem;
}
.inv-payment-row:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .inv-section-grid { grid-template-columns: 1fr; }
  .inv-details-grid { grid-template-columns: 1fr 1fr; }
  .inv-stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .inv-details-grid { grid-template-columns: 1fr; }
  .inv-stats-grid { grid-template-columns: 1fr; }
}

/* ===== Fav Button on Tool Cards ===== */
.tool-card { position: relative; }
.fav-btn {
  position: absolute; top: 50%; right: 0.6rem;
  transform: translateY(-50%);
  background: var(--color-bg); border: 1px solid var(--color-border);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: var(--color-text-muted);
  cursor: pointer; transition: all var(--transition);
  z-index: 5; opacity: 0; pointer-events: none;
  line-height: 1;
  box-shadow: var(--shadow);
}
.tool-card:hover .fav-btn { opacity: 1; pointer-events: auto; }
.fav-btn:hover { border-color: #ea4335; color: #ea4335; transform: translateY(-50%) scale(1.1); }
.fav-btn.active {
  color: #ea4335; border-color: #ea4335; background: rgba(234,67,53,0.1);
  opacity: 1; pointer-events: auto;
}

/* ===== Fav Button Large (Tool Page) ===== */
/* ===== Favorites Section ===== */
#favorites { margin-bottom: 2rem; }
#favorites .tools-grid { min-height: 0; }

/* ===== Share Buttons ===== */
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  color: #fff; font-family: var(--font);
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.share-btn--twitter { background: #1da1f2; }
.share-btn--facebook { background: #1877f2; }
.share-btn--linkedin { background: #0a66c2; }
.share-btn--reddit { background: #ff4500; }
.share-btn--whatsapp { background: #25d366; }
.share-btn--copy { background: var(--color-text-muted); font-size: 1rem; }

/* ===== Countdown Timer Redesign ===== */
.ct-container { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 1rem 0; }
.ct-display-wrap { position: relative; width: 260px; height: 260px; }
.ct-ring { position: absolute; inset: 0; }
.ct-time-display {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ct-time {
  font-size: 3rem; font-weight: 700; font-family: var(--font-mono);
  color: var(--color-text); letter-spacing: 0.02em; line-height: 1;
}
.ct-label { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem; font-weight: 500; }
.ct-presets {
  display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center;
}
.ct-preset {
  padding: 0.4rem 0.9rem; border-radius: 24px; border: 1px solid var(--color-border);
  background: var(--color-bg); color: var(--color-text-muted); font-size: 0.82rem;
  font-weight: 500; cursor: pointer; transition: all var(--transition);
}
.ct-preset:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.ct-inputs {
  display: flex; align-items: center; gap: 0.5rem;
}
.ct-input-group { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.ct-input {
  width: 70px; text-align: center; padding: 0.5rem;
  font-size: 1.4rem; font-weight: 700; font-family: var(--font-mono);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ct-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(26,115,232,0.12); }
.ct-input-label { font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; }
.ct-colon { font-size: 1.5rem; font-weight: 700; color: var(--color-text-muted); }
.ct-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.ct-btn-main { min-width: 120px; font-size: 1rem; padding: 0.7rem 1.5rem; }
.ct-btn { min-width: 100px; }
.ct-complete .ct-time { color: var(--color-error); animation: ct-pulse 0.5s ease-in-out 3; }
@keyframes ct-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }

/* ===== Movie Suggester ===== */
/* Poster image */
.ms-poster-img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 0;
  transition: opacity 0.3s ease;
}
.ms-poster-img.loaded ~ .ms-poster-letter { display: none; }

/* Stepper */
.ms-stepper { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }
.ms-stepper-step { display: flex; align-items: center; gap: 0.4rem; }
.ms-stepper-num {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; border: 2px solid var(--color-border);
  color: var(--color-text-muted); background: var(--color-bg); transition: all var(--transition);
}
.ms-stepper-step.active .ms-stepper-num { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
.ms-stepper-step.done .ms-stepper-num { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.ms-stepper-lbl { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; }
.ms-stepper-step.active .ms-stepper-lbl { color: var(--color-primary); font-weight: 600; }
.ms-stepper-line { width: 50px; height: 2px; background: var(--color-border); margin: 0 0.4rem; transition: background 0.3s; }
.ms-stepper-step.done ~ .ms-stepper-line { background: var(--color-success); }

/* Wizard panels */
.ms-wizard { position: relative; overflow: hidden; }
.ms-panel { display: none; }
.ms-panel.active { display: block; animation: msFadeIn 0.35s ease both; }
.ms-step-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.25rem; }
.ms-step-sub { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 1.25rem; }

/* Genre / Mood / Decade card grids */
.ms-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 0.7rem; margin-bottom: 1.5rem; }
.ms-pick-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.1rem 0.5rem; border-radius: var(--radius); border: 1px solid var(--color-border);
  background: var(--color-bg); cursor: pointer; transition: all var(--transition); user-select: none; text-align: center;
}
.ms-pick-card:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ms-pick-card.selected { border-color: var(--color-primary); background: var(--color-primary-light); transform: scale(1.03); box-shadow: var(--shadow-glow); }
.ms-pick-card.selected::after {
  content: '\2713'; position: absolute; top: 5px; right: 7px;
  color: var(--color-primary); font-weight: 700; font-size: 0.8rem;
}
.ms-pick-emoji { font-size: 2rem; line-height: 1; margin-bottom: 0.35rem; }
.ms-pick-label { font-size: 0.82rem; font-weight: 500; color: var(--color-text); }

/* Step 3 refinement */
.ms-refine-section { margin-bottom: 1.25rem; }
.ms-refine-label { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; }
.ms-decade-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ms-decade-btn {
  padding: 0.4rem 0.9rem; border-radius: 24px; border: 1px solid var(--color-border);
  background: var(--color-bg); font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); color: var(--color-text);
}
.ms-decade-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ms-decade-btn.selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.ms-rating-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ms-rating-btn {
  padding: 0.4rem 0.9rem; border-radius: 24px; border: 1px solid var(--color-border);
  background: var(--color-bg); font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); color: var(--color-text);
}
.ms-rating-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ms-rating-btn.selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Nav buttons */
.ms-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 0.75rem; }

/* Results grid */
.ms-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.ms-card {
  display: flex; flex-direction: column; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; transition: all 0.25s ease;
  animation: msFadeIn 0.4s ease both; animation-delay: calc(var(--i, 0) * 0.07s);
}
.ms-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.ms-poster {
  width: 100%; height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.ms-poster::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}
.ms-poster-letter { font-size: 4rem; font-weight: 900; color: rgba(255,255,255,0.85); text-shadow: 0 2px 16px rgba(0,0,0,0.3); z-index: 1; }
.ms-poster-rating {
  position: absolute; bottom: 10px; right: 10px; z-index: 1;
  background: rgba(0,0,0,0.7); color: #fbbc04; font-size: 0.8rem;
  font-weight: 700; padding: 3px 10px; border-radius: 24px; backdrop-filter: blur(4px);
}
.ms-poster-year {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: rgba(0,0,0,0.5); color: #fff; font-size: 0.75rem;
  font-weight: 500; padding: 2px 10px; border-radius: 24px; backdrop-filter: blur(4px);
}
.ms-info { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.ms-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.1rem; }
.ms-year { font-weight: 400; color: var(--color-text-muted); font-size: 0.9rem; }
.ms-director { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.4rem; }
.ms-stars { color: #fbbc04; font-size: 0.85rem; margin-bottom: 0.4rem; letter-spacing: 1px; }
.ms-match {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem; font-size: 0.78rem; font-weight: 500;
}
.ms-match-track { flex: 1; height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; }
.ms-match-bar { height: 100%; border-radius: 3px; background: var(--color-primary); transition: width 0.6s ease; }
.ms-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.ms-tags .chip { font-size: 0.68rem; padding: 1px 8px; cursor: default; }
.ms-desc { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; margin: 0 0 0.75rem; flex: 1; }
.ms-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }
.ms-trailer-link {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 500;
  color: #ea4335; text-decoration: none; padding: 0.3rem 0.75rem;
  border: 1px solid #ea4335; border-radius: 24px; transition: all var(--transition);
}
.ms-trailer-link:hover { background: #ea4335; color: #fff; }
.ms-imdb-link {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 500;
  color: var(--color-primary); text-decoration: none; padding: 0.3rem 0.75rem;
  border: 1px solid var(--color-primary); border-radius: 24px; transition: all var(--transition);
}
.ms-imdb-link:hover { background: var(--color-primary); color: #fff; }

@keyframes msFadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .ms-card-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
  .ms-pick-card { padding: 0.7rem 0.25rem; }
  .ms-pick-emoji { font-size: 1.5rem; }
  .ms-pick-label { font-size: 0.75rem; }
  .ms-results-grid { grid-template-columns: 1fr; }
  .ms-stepper-lbl { display: none; }
  .ms-stepper-line { width: 28px; }
  .ms-poster { height: 160px; }
}

/* ===== XLSX/CSV Converter ===== */
.xc-tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 2px solid var(--color-border); }
.xc-tab {
  padding: 0.6rem 1.25rem; font-weight: 500; font-size: 0.9rem; border: none; background: none;
  color: var(--color-text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
}
.xc-tab:hover { color: var(--color-text); }
.xc-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.xc-panel { display: none; }
.xc-panel.active { display: block; }
.xc-upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; border: 2px dashed var(--color-border); border-radius: var(--radius);
  background: var(--color-bg); cursor: pointer; transition: all var(--transition); text-align: center;
}
.xc-upload-zone:hover, .xc-upload-zone.dragover { border-color: var(--color-primary); background: var(--color-primary-light); }
.xc-upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.xc-upload-text { font-size: 0.9rem; color: var(--color-text-muted); }
.xc-preview-wrap { max-height: 400px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.xc-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.xc-table th {
  position: sticky; top: 0; background: var(--color-surface); padding: 0.5rem 0.65rem;
  text-align: left; font-weight: 600; border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.xc-table td { padding: 0.4rem 0.65rem; border-bottom: 1px solid var(--color-border); white-space: nowrap; max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.xc-table tr:hover td { background: var(--color-surface); }

/* ===== Full-page tool layout ===== */
.site-main:has(.tool-fullpage) { padding: 0; }
.tool-fullpage-breadcrumbs {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--color-text-muted);
  padding: 0.45rem 1rem; border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.tool-fullpage-breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.tool-fullpage-breadcrumbs a:hover { color: var(--color-primary); }
.tool-fullpage-breadcrumbs .sep { opacity: 0.4; }
.tool-header--fullwidth {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 1.25rem 0.4rem;
  margin-bottom: 0;
}
.tool-header--fullwidth .tool-tagline { margin: 0; font-size: 0.85rem; }
.tool-header--fullwidth h1 { font-size: 1.35rem; margin-bottom: 0; }
.tool-header--fullwidth .tool-header-top { align-items: center; }
.tool-fullpage {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - var(--header-h) - 30px);
  padding: 0;
  overflow: hidden;
}
.tool-header--below {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .tool-fullpage { height: calc(100vh - var(--header-h) - 28px); }
  .tool-header--below { margin-top: 1.5rem; }
  .tool-fullpage-breadcrumbs { padding: 0.4rem 0.75rem; font-size: 0.72rem; }
}

/* ===== Cloud Sync — "Sync With Google" button ===== */
.sync-google-btn {
  position: relative; display: flex; align-items: center; gap: 6px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text); padding: 7px 16px; border-radius: 24px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.sync-google-btn:hover { border-color: var(--color-primary); color: var(--color-primary); box-shadow: var(--shadow); }
.sync-google-btn.active { border-color: var(--color-primary); color: var(--color-primary); }
.sync-google-btn.synced { border-color: #34a853; color: #1e8e3e; }
.sync-google-btn.synced:hover { border-color: #137333; color: #137333; }
.sync-google-btn.loading { opacity: 0.6; pointer-events: none; }
.sync-google-icon { flex-shrink: 0; }
.cloud-sync-dot {
  position: absolute; top: -2px; right: -2px; width: 7px; height: 7px;
  border-radius: 50%; display: none;
}
.cloud-sync-dot.connected { display: block; background: #34a853; }
.cloud-sync-dot.disconnected { display: block; background: var(--color-text-muted); }

/* Shared overlay */
.cs-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.cs-overlay.open { opacity: 1; pointer-events: auto; }

/* Slide-out sync panel */
.cs-panel {
  position: fixed; top: 0; right: -400px; width: 380px; max-width: 90vw;
  height: 100vh; background: var(--color-bg); z-index: 1000;
  box-shadow: var(--shadow-lg); transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.cs-panel.open { right: 0; }
.cs-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-border);
}
.cs-panel-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.cs-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--color-text-muted); line-height: 1; padding: 4px 8px;
  border-radius: 50%;
}
.cs-close:hover { color: var(--color-text); background: var(--color-surface); }
.cs-panel-body { padding: 1.5rem; flex: 1; }

.cs-status-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  background: rgba(52,168,83,0.08); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 1.25rem;
}
.cs-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cs-status-dot--on { background: #34a853; }
.cs-sync-actions { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.cs-sync-actions .btn { flex: 1; font-size: 0.88rem; }
.cs-last-sync { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.cs-sync-log {
  font-size: 0.8rem; color: var(--color-text-muted); max-height: 160px;
  overflow-y: auto; line-height: 1.6;
}
.cs-sync-log .cs-log-item { padding: 2px 0; }
.cs-sync-log .cs-log-ok::before { content: "\2713 "; color: #34a853; }
.cs-sync-log .cs-log-err::before { content: "\2717 "; color: var(--color-error); }
.cs-divider { border: none; border-top: 1px solid var(--color-border); margin: 1.25rem 0; }
.cs-disconnect-btn { width: 100%; color: var(--color-error); border-color: var(--color-error); }
.cs-disconnect-btn:hover { background: var(--color-error); color: #fff; }

/* ===== Command Palette (Ctrl+K) ===== */
.cmdk-trigger {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.65rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  color: var(--color-text-muted);
  font-size: 0.82rem; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  min-width: 200px;
}
.cmdk-trigger:hover { border-color: var(--color-primary); box-shadow: var(--shadow); }
.cmdk-trigger-icon { font-size: 0.85rem; flex-shrink: 0; }
.cmdk-trigger-text { flex: 1; text-align: left; }
.cmdk-trigger-kbd {
  font-family: inherit; font-size: 0.65rem; font-weight: 600;
  background: var(--color-bg); border: 1px solid var(--color-border);
  padding: 1px 6px; border-radius: 4px; color: var(--color-text-muted);
  line-height: 1.4;
}

/* Overlay */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.4);
  display: flex; justify-content: center; padding-top: 18vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
}
.cmdk-overlay.open {
  opacity: 1; pointer-events: auto;
}
[data-theme="dark"] .cmdk-overlay {
  background: rgba(0,0,0,0.6);
}

/* Modal */
.cmdk-modal {
  width: 100%; max-width: 640px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: 480px;
  transform: scale(0.98) translateY(8px);
  transition: transform 0.15s ease;
  box-shadow: var(--shadow-lg);
}
.cmdk-overlay.open .cmdk-modal {
  transform: scale(1) translateY(0);
}

/* Input */
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.cmdk-search-icon { font-size: 1rem; color: var(--color-text-muted); flex-shrink: 0; }
.cmdk-input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 1rem; font-family: inherit; color: var(--color-text);
}
.cmdk-input::placeholder { color: var(--color-text-muted); }
.cmdk-esc {
  font-family: inherit; font-size: 0.65rem; font-weight: 600;
  background: var(--color-surface); border: 1px solid var(--color-border);
  padding: 2px 6px; border-radius: 4px; color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Body / List */
.cmdk-body {
  flex: 1; overflow-y: auto; padding: 0.5rem;
  overscroll-behavior: contain;
}
.cmdk-group-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-muted);
  padding: 0.6rem 0.6rem 0.3rem;
}
.cmdk-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; color: var(--color-text);
  transition: background var(--transition);
}
.cmdk-item:hover, .cmdk-item.active {
  background: var(--color-primary-light);
}
[data-theme="dark"] .cmdk-item:hover,
[data-theme="dark"] .cmdk-item.active {
  background: rgba(138,180,248,0.08);
}
.cmdk-item-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  border: none;
  border-radius: 10px;
  font-size: 1rem; flex-shrink: 0;
}
.cmdk-item-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.cmdk-item-name {
  font-size: 0.88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmdk-item-name mark {
  background: none; color: var(--color-primary); font-weight: 700;
}
.cmdk-item-desc {
  font-size: 0.75rem; color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmdk-item-cat {
  font-size: 0.7rem; color: var(--color-text-muted);
  flex-shrink: 0; white-space: nowrap;
}

/* Empty */
.cmdk-empty {
  text-align: center; padding: 2rem 1rem;
  color: var(--color-text-muted); font-size: 0.9rem;
}

/* Footer */
.cmdk-footer {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.7rem; color: var(--color-text-muted);
}
.cmdk-footer kbd {
  display: inline-block;
  font-family: inherit; font-size: 0.62rem; font-weight: 600;
  background: var(--color-surface); border: 1px solid var(--color-border);
  padding: 1px 4px; border-radius: 3px; min-width: 16px; text-align: center;
}

/* Mobile */
@media (max-width: 768px) {
  .cmdk-trigger { min-width: 0; }
  .cmdk-trigger-text { display: none; }
  .cmdk-trigger-kbd { display: none; }
  .cmdk-trigger { padding: 0.35rem 0.5rem; }
  .cmdk-overlay { padding-top: 0; align-items: flex-start; }
  .cmdk-modal { max-width: 100%; max-height: 100vh; border-radius: 0; border: none; }
}

/* ===== Tool Guide Link ===== */
.tool-guide-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.tool-guide-link svg { flex-shrink: 0; color: var(--color-primary); }
.tool-guide-link a { font-weight: 500; }

/* ===== Article Page ===== */
.article-page { padding-bottom: 3rem; }

.article-header {
  text-align: center;
  padding: 2.5rem 0 2rem;
  max-width: 800px;
  margin: 0 auto;
}
.article-category-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 24px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.article-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.article-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.article-cta-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.article-cta-top .btn-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
}
.article-cta-note {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* Table of Contents */
.article-toc {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.article-toc h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.article-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.article-toc li { list-style: none; }
.article-toc a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  padding: 2px 0;
  display: inline-block;
}
.article-toc a:hover { text-decoration: underline; }

/* Article Sections */
.article-section {
  max-width: 800px;
  margin: 0 auto 2.5rem;
}
.article-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}
.article-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* Features Grid */
.article-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.article-feature {
  padding: 1.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.article-feature-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}
.article-feature h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.article-feature p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Steps */
.article-steps {
  list-style: none;
  counter-reset: steps;
  margin-top: 1rem;
}
.article-steps li {
  margin-bottom: 1rem;
}
.article-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.article-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
}
.article-step p { margin: 0; padding-top: 6px; }

/* Inline CTA */
.article-cta-inline {
  text-align: center;
  margin: 1.5rem 0;
}

/* Checklist */
.article-checklist {
  list-style: none;
  margin-top: 1rem;
}
.article-checklist li {
  position: relative;
  padding: 0.625rem 0 0.625rem 2rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
  line-height: 1.5;
}
.article-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Use Cases */
.article-use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.article-use-case {
  padding: 1.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.article-use-case h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--color-primary);
}
.article-use-case p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Bottom CTA */
.article-bottom-cta { margin-top: 3rem; }
.article-cta-box {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.article-cta-box h2 {
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
}
.article-cta-box p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* Article responsive */
@media (max-width: 600px) {
  .article-header h1 { font-size: 1.5rem; }
  .article-subtitle { font-size: 0.95rem; }
  .article-section h2 { font-size: 1.25rem; }
  .article-features-grid { grid-template-columns: 1fr; }
  .article-use-cases { grid-template-columns: 1fr; }
  .article-toc ul { flex-direction: column; gap: 0.25rem; }
}

/* ===== Decision Maker ===== */
.dm-wrap { max-width: 720px; margin: 0 auto; }

/* Tabs */
.dm-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dm-tabs::-webkit-scrollbar { display: none; }
.dm-tab {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.1rem; font-weight: 500; font-size: 0.9rem;
  border: none; background: none; color: var(--color-text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.dm-tab:hover { color: var(--color-text); }
.dm-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.dm-tab-icon { font-size: 1.1rem; line-height: 1; }

/* Panels */
.dm-panel { animation: dmFadeIn 0.3s ease both; }
@keyframes dmFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Textarea */
.dm-textarea {
  width: 100%; resize: vertical; min-height: 120px; font-size: 0.92rem;
  line-height: 1.7; border-radius: var(--radius); padding: 0.85rem 1rem;
}

/* Action button */
.dm-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; margin-top: 1rem; padding: 0.85rem 1.5rem;
  font-size: 1rem; font-weight: 600; border-radius: var(--radius);
  transition: all var(--transition);
}
.dm-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,115,232,0.3); }
.dm-action-btn:active { transform: translateY(0); }
.dm-btn-icon { font-size: 1.15rem; line-height: 1; }

/* Result box */
.dm-result-box {
  margin-top: 1.5rem; padding: 1.75rem 1.5rem; text-align: center;
  background: var(--color-primary-light); border: 1px solid var(--color-primary);
  border-radius: var(--radius); animation: dmFadeIn 0.35s ease both;
}
.dm-result-label {
  font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.dm-result-value {
  font-size: 1.75rem; font-weight: 700; color: var(--color-primary);
  line-height: 1.3; word-break: break-word;
}

/* Wheel */
.dm-wheel-area {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 1.5rem; position: relative;
}
.dm-wheel-pointer {
  font-size: 1.75rem; color: var(--color-primary); line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
  z-index: 2; margin-bottom: -6px;
}
#wheelCanvas { border-radius: 50%; box-shadow: 0 4px 24px rgba(0,0,0,0.12); }

/* Pros & Cons — Setup */
.dm-pc-options-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.dm-pc-option-row { display: flex; align-items: center; gap: 0.5rem; }
.dm-pc-option-row .tool-input { flex: 1; }
.dm-pc-option-row .dm-pc-remove-opt {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: none;
  color: var(--color-text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all var(--transition);
}
.dm-pc-option-row .dm-pc-remove-opt:hover { color: #ef4444; }
.dm-pc-add-link {
  display: inline-block; border: none; background: none; color: var(--color-primary);
  font-size: 0.85rem; font-weight: 500; cursor: pointer; padding: 0.4rem 0;
  transition: color var(--transition);
}
.dm-pc-add-link:hover { color: var(--color-primary-hover); }

/* Comparison cards */
.dm-pc-card {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 1.25rem; background: var(--color-surface); margin-bottom: 1rem;
}
.dm-pc-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--color-border);
}
.dm-pc-card-title { font-size: 1.05rem; font-weight: 600; }
.dm-pc-card-score {
  font-size: 0.82rem; font-weight: 600; padding: 2px 10px; border-radius: 12px;
}
.dm-pc-card-score--pos { background: rgba(34,197,94,0.1); color: #16a34a; }
.dm-pc-card-score--neg { background: rgba(239,68,68,0.1); color: #dc2626; }
.dm-pc-card-score--zero { background: var(--color-border); color: var(--color-text-muted); }
.dm-pc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.dm-pc-section { min-width: 0; }
.dm-pc-section-label {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.5rem;
}
.dm-pc-section-label--pro { color: #22c55e; }
.dm-pc-section-label--con { color: #ef4444; }

/* Items */
.dm-pc-list { min-height: 0; }
.dm-pc-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.5rem; font-size: 0.85rem; border-radius: 6px;
  margin-bottom: 0.25rem; transition: background var(--transition);
}
.dm-pc-item:hover { background: var(--color-surface); }
.dm-pc-item--pro .dm-pc-item-icon { color: #22c55e; }
.dm-pc-item--con .dm-pc-item-icon { color: #ef4444; }
.dm-pc-item-icon { flex-shrink: 0; font-size: 0.75rem; width: 16px; text-align: center; }
.dm-pc-item-text { flex: 1; min-width: 0; }
.dm-pc-item-weight {
  font-size: 0.72rem; font-weight: 500; color: var(--color-text-muted); flex-shrink: 0;
}
.dm-pc-item-del {
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: none; color: var(--color-text-muted); cursor: pointer;
  font-size: 0.8rem; line-height: 1; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; opacity: 0; transition: all var(--transition);
}
.dm-pc-item:hover .dm-pc-item-del { opacity: 1; }
.dm-pc-item-del:hover { color: #ef4444; }
.dm-pc-empty {
  font-size: 0.82rem; color: var(--color-text-muted); padding: 0.75rem 0;
}

/* Add row */
.dm-pc-add-row {
  display: flex; gap: 0.4rem; margin-top: 0.5rem; align-items: center;
}
.dm-pc-add-row input {
  flex: 1; font-size: 0.85rem; padding: 0.4rem 0.65rem; min-width: 0;
}
.dm-pc-add-row button { flex-shrink: 0; }

/* Weight slider */
.dm-pc-weight-wrap {
  display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
}
.dm-pc-weight-wrap input[type="range"] {
  width: 60px; height: 4px; accent-color: var(--color-primary); cursor: pointer;
}
.dm-pc-weight-val {
  font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted);
  width: 14px; text-align: center;
}

/* Hint text */
.dm-pc-hint {
  font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Results */
.dm-pc-result { margin-top: 1.5rem; animation: dmFadeIn 0.35s ease both; }
.dm-pc-result-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem; }
.dm-pc-result-card {
  padding: 1rem 1.25rem; margin-bottom: 0.6rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface);
}
.dm-pc-result-card--winner { border-color: var(--color-primary); border-width: 2px; background: var(--color-primary-light); }
.dm-pc-result-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem;
}
.dm-pc-result-name { font-size: 1rem; font-weight: 600; }
.dm-pc-result-score { font-size: 1.1rem; font-weight: 700; }
.dm-pc-result-score--pos { color: #22c55e; }
.dm-pc-result-score--neg { color: #ef4444; }
.dm-pc-result-meta {
  display: flex; gap: 1rem; font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 0.4rem;
}
.dm-pc-result-bar {
  height: 6px; border-radius: 99px; overflow: hidden; background: var(--color-border);
}
.dm-pc-result-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* Coin */
.dm-coin-stage {
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  padding: 1.5rem 0;
}
.dm-coin-perspective { perspective: 600px; width: 140px; height: 140px; }
.dm-coin {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform 0.8s ease-in-out;
  cursor: pointer;
}
.dm-coin:hover { filter: brightness(1.05); }
.dm-coin-face {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800; backface-visibility: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15), inset 0 -2px 6px rgba(0,0,0,0.1);
}
.dm-coin-heads {
  background: linear-gradient(145deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
  color: #78350f;
}
.dm-coin-tails {
  background: linear-gradient(145deg, #cbd5e1 0%, #94a3b8 50%, #64748b 100%);
  color: #1e293b; transform: rotateY(180deg);
}
.dm-coin-result {
  font-size: 1.5rem; font-weight: 700; animation: dmFadeIn 0.3s ease both;
}
.dm-coin-history {
  display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; max-width: 360px;
}
.dm-coin-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 0.75rem; font-weight: 700; transition: all var(--transition);
}
.dm-coin-chip--h { background: #fef3c7; color: #92400e; }
.dm-coin-chip--t { background: #e2e8f0; color: #475569; }
.dm-coin-stats {
  font-size: 0.85rem; color: var(--color-text-muted); font-weight: 500; text-align: center;
}

/* History */
.dm-history-section {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.dm-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0; border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
}
.dm-history-item:last-child { border-bottom: none; }
.dm-history-result { font-weight: 600; }
.dm-history-type {
  font-size: 0.78rem; color: var(--color-text-muted); margin-left: 0.5rem;
}
.dm-history-time { font-size: 0.78rem; color: var(--color-text-muted); flex-shrink: 0; }
.dm-clear-history { margin-top: 0.75rem; }

/* Responsive */
@media (max-width: 640px) {
  .dm-tab { padding: 0.6rem 0.8rem; font-size: 0.82rem; }
  .dm-tab-icon { font-size: 1rem; }
  .dm-result-value { font-size: 1.4rem; }
  .dm-coin-perspective { width: 110px; height: 110px; }
  .dm-coin-face { font-size: 2rem; }
  #wheelCanvas { width: 280px; height: 280px; }
  .dm-pc-row { grid-template-columns: 1fr; gap: 1rem; }
  .dm-pc-item-del { opacity: 1; }
  .dm-pc-weight-wrap input[type="range"] { width: 48px; }
}
