/* =====================================================================
   FILESIZEHUB - MODERN UTILITY STYLESHEET
   Clean, Human-Made, Trustworthy, Fast & Accessible (Light/Dark Mode)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. CSS Custom Properties / Color System
   --------------------------------------------------------------------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Theme Tokens - Light (Default) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-subtle-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverted: #ffffff;

  --border-main: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #0284c7;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-subtle: #f0f9ff;
  --accent-teal: #0d9488;
  --accent-teal-subtle: #f0fdfa;
  --accent-green: #16a34a;
  --accent-green-subtle: #f0fdf4;
  --accent-amber: #d97706;
  --accent-amber-subtle: #fffbeb;
  --accent-rose: #e11d48;
  --accent-rose-subtle: #fff1f2;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-dropdown: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --container-max: 1200px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-surface: #1e293b;
  --bg-subtle: #0f172a;
  --bg-subtle-hover: #1e293b;
  --bg-glass: rgba(30, 41, 59, 0.85);

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverted: #0f172a;

  --border-main: #334155;
  --border-subtle: #1e293b;
  --border-focus: #38bdf8;

  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-primary-subtle: #082f49;
  --accent-teal: #2dd4bf;
  --accent-teal-subtle: #042f2e;
  --accent-green: #4ade80;
  --accent-green-subtle: #052e16;
  --accent-amber: #fbbf24;
  --accent-amber-subtle: #451a03;
  --accent-rose: #fb7185;
  --accent-rose-subtle: #4c0519;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-dropdown: 0 12px 28px -4px rgba(0, 0, 0, 0.7);
}

/* ---------------------------------------------------------------------
   2. Reset & Base Typography
   --------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1 0 auto;
}

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

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

img, svg {
  vertical-align: middle;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------------------------------------------------------------------
   3. Layout Container
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  min-width: 0;
  box-sizing: border-box;
}

.skip-to-content {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 99999;
}
.skip-to-content:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------------
   4. Header & Navigation
   --------------------------------------------------------------------- */
.top-announcement-bar {
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-main);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.375rem 0;
}
.announcement-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}
.announcement-pill {
  background-color: var(--accent-teal-subtle);
  color: var(--accent-teal);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.announcement-text {
  min-width: 0;
  flex: 1 1 auto;
  word-break: break-word;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-main);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-icon {
  width: 32px;
  height: 32px;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.15;
}
.brand-highlight {
  color: var(--accent-primary);
}
.brand-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Header Search */
.header-search-wrap {
  position: relative;
  flex: 1 1 360px;
  max-width: 420px;
}
.header-search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.header-search-box:focus-within {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.header-search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-main);
}
.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-kbd {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.1rem 0.35rem;
  color: var(--text-muted);
}

.search-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1010;
}
.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  transition: background-color var(--transition-fast);
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover, .search-result-item.selected {
  background-color: var(--bg-subtle);
}
.search-result-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent-primary);
  display: block;
}
.search-result-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Nav Menu */
.site-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}
.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
  background-color: var(--accent-primary-subtle);
}

/* Dropdown */
.nav-dropdown-parent {
  position: relative;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: 1020;
}
.nav-dropdown-parent:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: background-color var(--transition-fast);
}
.dropdown-item:hover {
  background-color: var(--bg-subtle);
  color: var(--accent-primary);
}
.dropdown-title {
  font-size: 0.875rem;
  font-weight: 500;
}
.dropdown-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.dropdown-divider {
  height: 1px;
  background-color: var(--border-main);
  margin: 0.35rem 0;
}
.dropdown-view-all {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 0.4rem 0.75rem;
  display: block;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  color: var(--accent-primary);
  border-color: var(--border-focus);
}
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: block; }

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-main);
  z-index: 999;
  padding: 1.25rem;
  overflow-y: auto;
}
.mobile-drawer.open {
  display: block;
}
.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.mobile-nav-list a {
  display: block;
  padding: 0.625rem 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
}
.mobile-nav-list a:hover {
  background-color: var(--bg-subtle);
  color: var(--accent-primary);
}
.mobile-category-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.25rem;
}
.mobile-sublink {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  padding-left: 1.5rem !important;
  color: var(--text-secondary) !important;
}
.mobile-divider {
  height: 1px;
  background: var(--border-main);
  margin: 0.5rem 0;
}

/* ---------------------------------------------------------------------
   5. Hero Section (Clean, Human, No AI Gradients)
   --------------------------------------------------------------------- */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border-main);
}
.hero-content {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0.5rem;
  background-color: var(--accent-primary-subtle);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: var(--accent-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}
.hero-title {
  font-size: clamp(2rem, 4vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-search-container {
  max-width: 600px;
  margin: 0 auto 1.5rem;
}
.hero-search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}
.hero-search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}
.hero-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: var(--text-main);
  margin-left: 0.625rem;
}

.hero-quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.quick-tag-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.quick-tag-chip:hover {
  background-color: var(--accent-primary-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ---------------------------------------------------------------------
   6. Tool Card Grid & Popular Section
   --------------------------------------------------------------------- */
.section-block {
  padding: 3rem 0;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.section-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.tool-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.tool-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.75rem;
}
.tool-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.tool-card:hover .tool-card-title {
  color: var(--accent-primary);
}
.tool-card-desc {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}
.tool-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}
.tool-category-badge {
  color: var(--text-muted);
  font-weight: 500;
}
.tool-cta-text {
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Category Filter Tabs on Tools Page */
.category-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* ---------------------------------------------------------------------
   7. Tool Detail / Calculator Page Layout
   --------------------------------------------------------------------- */
.tool-page-layout {
  padding: 2rem 0 4rem;
}
.breadcrumb-nav {
  margin-bottom: 1.5rem;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  gap: 0.5rem;
}
.breadcrumbs a {
  color: var(--text-muted);
}
.breadcrumbs a:hover {
  color: var(--accent-primary);
}
.breadcrumb-sep {
  color: var(--border-main);
}

.tool-header-block {
  margin-bottom: 2rem;
}
.tool-main-h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.375rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.tool-intro-p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 840px;
  line-height: 1.6;
}

/* Two Column Layout on Desktop */
.tool-grid-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: start;
}
.tool-main-col,
.tool-sidebar {
  min-width: 0;
  width: 100%;
}
@media (max-width: 992px) {
  .tool-grid-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The Calculator Card */
.calculator-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  min-width: 0;
  width: 100%;
}
.calc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.calc-card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.calc-badge-instant {
  background-color: var(--accent-teal-subtle);
  color: var(--accent-teal);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Form Controls & Inputs */
.calc-form-group {
  margin-bottom: 1.25rem;
  min-width: 0;
}
.calc-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.calc-label-help {
  font-weight: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}
.input-with-unit-group {
  display: flex;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  transition: all var(--transition-fast);
  min-width: 0;
  width: 100%;
}
.input-with-unit-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.calc-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  padding: 0.65rem 0.875rem;
  background: transparent;
  outline: none;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-main);
}
.calc-select {
  flex: 0 0 auto;
  border: none;
  border-left: 1px solid var(--border-main);
  padding: 0.65rem 0.875rem;
  background-color: var(--bg-subtle);
  outline: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  cursor: pointer;
  max-width: 55%;
}

.calc-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 0.875rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
}
.calc-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.calc-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn-calculate {
  flex: 1;
  background-color: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color var(--transition-fast);
}
.btn-calculate:hover {
  background-color: var(--accent-primary-hover);
}
.btn-reset {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-reset:hover {
  background-color: var(--bg-subtle-hover);
  color: var(--text-main);
}

/* Result Box */
.calc-result-box {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background-color: var(--accent-primary-subtle);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-md);
  min-width: 0;
  width: 100%;
}
.calc-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.calc-result-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}
.btn-copy-result {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-copy-result:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}
.calc-primary-result {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.calc-secondary-results {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(2, 132, 199, 0.2);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.sec-res-item {
  display: flex;
  flex-direction: column;
}
.sec-res-label {
  color: var(--text-muted);
}
.sec-res-val {
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Multi-Unit Conversion Matrix Table */
.conversion-matrix-card {
  margin-top: 1.5rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-surface);
}
.matrix-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.matrix-table th, .matrix-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.matrix-table th {
  background-color: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-secondary);
}
.matrix-table tr:last-child td {
  border-bottom: none;
}
.matrix-table tr:hover td {
  background-color: var(--bg-subtle);
}

/* ---------------------------------------------------------------------
   8. Educational Content Sections on Tool Pages
   --------------------------------------------------------------------- */
.tool-content-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}
.tool-content-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.tool-content-section h2:first-child {
  margin-top: 0;
}
.tool-content-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.tool-content-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.tool-content-section ul, .tool-content-section ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.tool-content-section li {
  margin-bottom: 0.35rem;
}

/* Formula & Example Box */
.formula-box {
  background-color: var(--bg-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  overflow-x: auto;
}
.example-box {
  background-color: var(--accent-teal-subtle);
  border-left: 4px solid var(--accent-teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  overflow-x: auto;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.faq-item {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  overflow: hidden;
}
.faq-question-btn {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-question-btn:hover {
  color: var(--accent-primary);
}
.faq-chevron {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
  color: var(--text-muted);
}
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.faq-item.active .faq-answer {
  display: block;
}

/* ---------------------------------------------------------------------
   9. Sidebar (Desktop) & AdSense Slots
   --------------------------------------------------------------------- */
.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}
.sidebar-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-width: 0;
}
.sidebar-widget:empty {
  display: none !important;
}
.sidebar-widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.625rem;
  margin-bottom: 0.875rem;
}
.sidebar-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-links-list a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  padding: 0.25rem 0;
}
.sidebar-links-list a:hover {
  color: var(--accent-primary);
  padding-left: 0.25rem;
}

/* Ad Placement Slots */
.ad-container-slot {
  margin: 1.75rem 0;
  text-align: center;
}
.ad-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.ad-box-wrapper {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder-box {
  width: 100%;
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.ad-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.ad-subtext {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   10. Blog Listing & Single Post Styling
   --------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}
.blog-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.blog-card-thumb {
  height: 180px;
  background-color: var(--accent-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}
.blog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.blog-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.blog-card:hover .blog-card-title {
  color: var(--accent-primary);
}
.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
}
.blog-card-footer {
  margin-top: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-primary);
}

/* Single Post Page */
.post-header-area {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
}
.post-title {
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 1rem;
}
.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-body-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.rich-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.rich-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.rich-content p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.rich-content blockquote {
  border-left: 4px solid var(--accent-primary);
  background-color: var(--bg-subtle);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-main);
}
.rich-content code {
  font-family: var(--font-mono);
  background-color: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
}
.rich-content pre {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.rich-content pre code {
  background: transparent;
  padding: 0;
}
.table-custom {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.table-custom th, .table-custom td {
  border: 1px solid var(--border-main);
  padding: 0.75rem 1rem;
  text-align: left;
}
.table-custom th {
  background-color: var(--bg-subtle);
  font-weight: 600;
}

.author-bio-card {
  display: flex;
  gap: 1.25rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2.5rem;
  align-items: center;
}
.author-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--accent-primary-subtle);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   11. Contact Form, Legal & Static Pages
   --------------------------------------------------------------------- */
.static-page-card {
  max-width: 840px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.contact-form-full {
  grid-column: 1 / -1;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.btn-submit {
  background-color: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.btn-submit:hover {
  background-color: var(--accent-primary-hover);
}

.alert-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.alert-success {
  background-color: var(--accent-green-subtle);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}
.alert-error {
  background-color: var(--accent-rose-subtle);
  border: 1px solid var(--accent-rose);
  color: var(--accent-rose);
}

/* ---------------------------------------------------------------------
   12. Footer
   --------------------------------------------------------------------- */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-main);
  margin-top: 4rem;
}
.footer-usp-bar {
  border-bottom: 1px solid var(--border-main);
  padding: 2rem 0;
  background-color: var(--bg-subtle);
}
.footer-usp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}
.usp-item {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  min-width: 0;
}
.usp-icon {
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.usp-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}
.usp-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.footer-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3rem 0;
}
.footer-col {
  min-width: 0;
}
.footer-brand .brand-name {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-main);
}
.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.75rem 0 1.25rem;
  line-height: 1.6;
}
.footer-compliance-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}
.footer-col-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}
.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-link-list a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.footer-link-list a:hover {
  color: var(--accent-primary);
}

.footer-bottom-bar {
  border-top: 1px solid var(--border-main);
  padding: 1.25rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-meta-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.footer-meta-links a {
  color: var(--text-muted);
}
.footer-meta-links a:hover {
  color: var(--accent-primary);
}
.admin-portal-link {
  font-weight: 600;
  color: var(--text-secondary) !important;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--text-main);
  color: var(--text-inverted);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease forwards;
}
@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------------------
   13. Responsive Breakpoints
   --------------------------------------------------------------------- */
@media (max-width: 992px) {
  .site-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .header-search-wrap { max-width: 260px; }
  .tool-grid-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .tool-page-layout {
    padding: 1.25rem 0 2rem;
  }
  .site-footer {
    margin-top: 2rem;
  }
  .footer-usp-bar {
    padding: 1.25rem 0;
  }
  .footer-usp-grid {
    grid-template-columns: 1fr;
    gap: 1.125rem;
  }
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem 0;
  }
  .footer-tagline {
    margin: 0.5rem 0 0.875rem;
    font-size: 0.84375rem;
    line-height: 1.5;
  }
  .footer-col-title {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
  }
  .footer-link-list {
    gap: 0.35rem;
  }
  .footer-link-list a {
    font-size: 0.8125rem;
    padding: 0.15rem 0;
    display: inline-block;
  }
  .footer-bottom-bar {
    padding: 1rem 0;
  }
  .footer-bottom-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
  .copyright-text {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.5;
  }
  .footer-meta-links {
    justify-content: center;
    gap: 0.35rem 0.625rem;
    font-size: 0.75rem;
  }
  .footer-meta-links a {
    white-space: nowrap;
  }
  .hero-section {
    padding: 2.25rem 0 1.75rem;
  }
  .section-block {
    padding: 2rem 0;
  }
}

@media (max-width: 600px) {
  .header-search-wrap { display: none; }
  .calculator-card [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .calculator-card {
    padding: 1.125rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
  }
  .calc-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
  .calc-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .btn-calculate,
  .btn-reset {
    width: 100%;
  }
  .calc-result-box {
    padding: 1rem;
  }
  .tool-content-section {
    padding: 1.25rem 1rem;
  }
  .breadcrumbs {
    font-size: 0.75rem;
    gap: 0.35rem 0.5rem;
  }
  .tool-main-h1 {
    font-size: 1.625rem;
  }
  .tool-intro-p {
    font-size: 0.9375rem;
  }
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .announcement-content {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    justify-content: center;
    text-align: center;
  }
  .calc-input {
    font-size: 1rem;
    padding: 0.55rem 0.65rem;
  }
  .calc-select {
    font-size: 0.8125rem;
    padding: 0.55rem 0.5rem;
    max-width: 52%;
  }
  .calc-radio-label {
    font-size: 0.8125rem;
  }
  .formula-box,
  .example-box {
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .footer-meta-links .sep {
    margin: 0 0.15rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .calc-card-title {
    font-size: 0.9375rem;
  }
  .calc-select {
    font-size: 0.75rem;
    padding: 0.5rem 0.375rem;
    max-width: 50%;
  }
  .calc-input {
    font-size: 0.9375rem;
    padding: 0.5rem 0.5rem;
  }
  .btn-calculate {
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
  }
  .btn-reset {
    font-size: 0.8125rem;
    padding: 0.65rem 1rem;
  }
  .matrix-table {
    font-size: 0.8125rem;
    min-width: 380px;
  }
  .matrix-table th,
  .matrix-table td {
    padding: 0.5rem 0.625rem;
  }
}

/* Calculator Form Validation & Formula Elements */
.calc-inline-error {
  display: none;
  color: var(--accent-rose, #ef4444);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.35rem;
  line-height: 1.35;
}
.calc-input.input-error,
.form-input.input-error {
  border-color: var(--accent-rose, #ef4444) !important;
  box-shadow: 0 0 0 1px var(--accent-rose, #ef4444) !important;
}
.sec-res-formula {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}
.sec-res-formula .sec-res-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  word-break: break-word;
  white-space: normal;
}

