/* =============================================
   EasyGrader.org - Main Stylesheet
   Version: 1.0.0
   ============================================= */

/* === CSS VARIABLES === */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #4f46e5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #334155;
  --border-focus: #818cf8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.3);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; font-weight: 700; color: var(--text); }

/* === SKIP LINK (ACCESSIBILITY) === */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--primary); color: #fff;
  padding: 8px 16px; z-index: 9999;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* === HEADER === */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), box-shadow var(--transition);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800;
  color: var(--primary); text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem; font-weight: 900;
}
.logo-text span { color: var(--secondary); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--primary); background: var(--bg-secondary); text-decoration: none; }
.main-nav a.active { color: var(--primary); background: rgba(79,70,229,.1); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Dark mode toggle */
.theme-toggle {
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  color: var(--text-muted);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,.05); }

/* Mobile menu */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f5ff 50%, #f0fff4 100%);
  padding: 56px 20px 0;
  text-align: center;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #0c4a6e 50%, #064e3b 100%);
}
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(79,70,229,.1); color: var(--primary);
  border: 1px solid rgba(79,70,229,.2);
  padding: 6px 16px; border-radius: 50px;
  font-size: .85rem; font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  margin-bottom: 32px; max-width: 580px; margin-left: auto; margin-right: auto;
}

/* === MAIN TOOL CARD === */
.tool-wrapper {
  max-width: 1100px; margin: 0 auto;
  padding: 0 20px 48px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: -20px;
}
.tool-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.tool-tab {
  flex: 1; padding: 16px 20px;
  background: none; border: none;
  font-size: .95rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
}
.tool-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}
.tool-tab:hover:not(.active) { color: var(--text); background: rgba(0,0,0,.02); }

.tool-body { padding: 32px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Inputs */
.input-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label {
  font-size: .9rem; font-weight: 600;
  color: var(--text-muted);
}
.input-group label span { color: var(--danger); margin-left: 2px; }
.input-field {
  width: 100%; padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1.15rem; font-weight: 600;
  transition: all var(--transition);
  outline: none;
  -moz-appearance: textfield;
}
.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button { -webkit-appearance: none; }
.input-field:focus { border-color: var(--border-focus); background: var(--bg); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.input-field.error { border-color: var(--danger); }
.input-hint { font-size: .78rem; color: var(--text-light); }
.error-msg { font-size: .82rem; color: var(--danger); display: none; }
.error-msg.show { display: block; }

/* Grade Scale Toggle */
.scale-toggle {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.scale-toggle label { font-size: .9rem; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.scale-options { display: flex; gap: 8px; flex-wrap: wrap; }
.scale-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  font-size: .85rem; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.scale-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.scale-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Action Buttons */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: .95rem; font-weight: 600;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  flex: 1; justify-content: center;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,.4); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,.04); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--secondary); color: var(--secondary); }
.btn:active { transform: scale(.98); }

/* === RESULT DISPLAY === */
.result-box {
  display: none;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  animation: fadeSlideUp .3s ease;
}
.result-box.show { display: block; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative; overflow: hidden;
}
.result-item::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.result-item.score::before { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.result-item.grade::before { background: linear-gradient(90deg, var(--success), #34d399); }
.result-item.wrong::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.result-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.result-value {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
}
.result-item.score .result-value { color: var(--primary); }
.result-item.grade .result-value { color: var(--success); }
.result-item.wrong .result-value { color: var(--danger); }
.result-sub { font-size: .8rem; color: var(--text-light); margin-top: 4px; }

/* Grade Badge */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  font-size: 1.8rem; font-weight: 900;
  margin-bottom: 4px;
}
.grade-A { background: rgba(16,185,129,.15); color: #059669; }
.grade-B { background: rgba(59,130,246,.15); color: #2563eb; }
.grade-C { background: rgba(245,158,11,.15); color: #d97706; }
.grade-D { background: rgba(249,115,22,.15); color: #ea580c; }
.grade-F { background: rgba(239,68,68,.15); color: #dc2626; }

/* Progress bar */
.score-bar-wrap { margin-top: 16px; }
.score-bar-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.score-bar {
  height: 10px; background: var(--border);
  border-radius: 50px; overflow: hidden;
}
.score-bar-fill {
  height: 100%; border-radius: 50px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0;
}

/* Share row */
.share-row {
  display: flex; gap: 10px; align-items: center;
  padding-top: 16px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.share-row span { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.btn-share {
  padding: 8px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: .82rem; font-weight: 600;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}
.btn-share:hover { border-color: var(--primary); color: var(--primary); }
.btn-copy { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-copy:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.copy-feedback {
  font-size: .78rem; color: var(--success); font-weight: 500;
  opacity: 0; transition: opacity .3s;
}
.copy-feedback.show { opacity: 1; }

/* === GRADING TABLE === */
.table-controls {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.table-controls label { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.table-select {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: .9rem; font-weight: 500;
  outline: none; cursor: pointer;
}
.table-select:focus { border-color: var(--border-focus); }
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.grade-table { width: 100%; border-collapse: collapse; }
.grade-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  font-size: .82rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.grade-table td {
  padding: 11px 16px;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.grade-table tr:last-child td { border-bottom: none; }
.grade-table tbody tr:hover td { background: rgba(79,70,229,.03); }
.grade-table .score-cell { font-weight: 700; }
.grade-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 28px; padding: 0 10px;
  border-radius: 50px; font-size: .82rem; font-weight: 700;
}
.highlight-row td { background: rgba(79,70,229,.06) !important; }
.highlight-row .score-cell { color: var(--primary); }

/* Custom scale editor */
.custom-scale { margin-top: 16px; display: none; }
.custom-scale.show { display: block; }
.custom-scale-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.cs-row { display: flex; align-items: center; gap: 8px; }
.cs-label { font-size: .85rem; font-weight: 700; min-width: 24px; }
.cs-input {
  flex: 1; padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: .9rem; font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
}
.cs-input::-webkit-outer-spin-button,
.cs-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cs-input:focus { border-color: var(--border-focus); }

/* === AD PLACEHOLDERS === */
.ad-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: .75rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.ad-top { height: 90px; margin-bottom: 24px; }
.ad-mid { height: 250px; margin: 32px 0; }
.ad-sidebar { height: 250px; margin-bottom: 20px; }

/* === CONTENT SECTION === */
.content-wrapper {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
}
.content-main { min-width: 0; }
.content-sidebar { min-width: 0; }

.section { margin-bottom: 48px; }
.section h2 {
  font-size: 1.6rem; margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section h2 .accent { color: var(--primary); }
.section h3 { font-size: 1.15rem; margin-bottom: 10px; margin-top: 20px; color: var(--text); }
.section p { color: var(--text-muted); margin-bottom: 14px; line-height: 1.75; }
.section ul { margin: 12px 0 14px 0; }
.section ul li {
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text-muted);
  margin-bottom: 10px; line-height: 1.65;
}
.section ul li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* Step cards */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: box-shadow var(--transition);
}
.step-card:hover { box-shadow: var(--shadow-md); }
.step-num {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .95rem;
  margin: 0 auto 12px;
}
.step-card h3 { font-size: .95rem; margin-bottom: 6px; }
.step-card p { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* Benefit cards */
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; }
.benefit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.benefit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.benefit-icon { font-size: 2rem; margin-bottom: 12px; }
.benefit-card h3 { font-size: 1rem; margin-bottom: 8px; }
.benefit-card p { font-size: .875rem; color: var(--text-muted); margin: 0; }

/* Example table */
.example-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin: 16px 0; }
.example-table { width: 100%; border-collapse: collapse; }
.example-table th {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 12px 16px;
  font-size: .85rem; font-weight: 600; text-align: left;
}
.example-table td { padding: 11px 16px; font-size: .875rem; border-bottom: 1px solid var(--border); }
.example-table tr:last-child td { border-bottom: none; }
.example-table tr:nth-child(even) td { background: var(--bg-secondary); }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  width: 100%; padding: 18px 20px;
  background: none; border: none;
  text-align: left;
  font-size: .95rem; font-weight: 600;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--bg-secondary); }
.faq-q .faq-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; transition: transform var(--transition);
  border: 1px solid var(--border);
}
.faq-item.open .faq-q .faq-icon { transform: rotate(180deg); background: var(--primary); color: #fff; border-color: var(--primary); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding: 0 20px;
  color: var(--text-muted); font-size: .9rem; line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 20px 18px; }

/* === SIDEBAR WIDGETS === */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.widget-title { font-size: .95rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.grade-ref-list { display: flex; flex-direction: column; gap: 8px; }
.grade-ref-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font-size: .85rem;
}
.grade-ref-chip {
  min-width: 32px; height: 28px; padding: 0 8px;
  border-radius: 6px; font-weight: 800; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.grade-ref-item .gp { margin-left: auto; color: var(--text-light); font-size: .78rem; }
.tips-list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .85rem; color: var(--text-muted);
  margin-bottom: 8px; line-height: 1.5;
}
.tips-list li::before { content: '💡'; flex-shrink: 0; }

/* === TOAST === */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* === INNER PAGE STYLES === */
.page-hero {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg));
  padding: 48px 20px;
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .page-hero { background: linear-gradient(135deg, var(--bg-secondary), var(--bg)); }
.page-hero-inner { max-width: 800px; margin: 0 auto; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }
.page-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 10px; }
.page-hero p { color: var(--text-muted); font-size: 1rem; }
.page-content { max-width: 800px; margin: 0 auto; padding: 48px 20px 64px; }
.page-content h2 { font-size: 1.4rem; margin-bottom: 14px; margin-top: 36px; }
.page-content h2:first-child { margin-top: 0; }
.page-content h3 { font-size: 1.1rem; margin-top: 24px; margin-bottom: 10px; }
.page-content p { color: var(--text-muted); margin-bottom: 14px; line-height: 1.8; }
.page-content ul { margin: 12px 0 16px 20px; list-style: disc; }
.page-content ul li { color: var(--text-muted); margin-bottom: 8px; line-height: 1.7; }
.page-content a { color: var(--primary); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.contact-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; text-align: center;
}
.contact-icon { font-size: 2rem; margin-bottom: 10px; }
.contact-card h3 { margin-bottom: 6px; }
.contact-card p { font-size: .875rem; color: var(--text-muted); margin: 0; }
.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.form-input, .form-textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text); font-size: .95rem;
  outline: none; transition: all var(--transition);
}
.form-input:focus, .form-textarea:focus { border-color: var(--border-focus); background: var(--bg); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-textarea { resize: vertical; min-height: 120px; }

/* === FOOTER === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}
.footer-main {
  max-width: 1200px; margin: 0 auto;
  padding: 48px 20px 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p { font-size: .875rem; color: var(--text-muted); margin-top: 14px; line-height: 1.7; }
.footer-logo { font-size: 1.2rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.footer-col h4 { font-size: .9rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: .875rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: .82rem; color: var(--text-light);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--primary); }

/* === STATS BAR === */
.stats-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 20px;
}
.stats-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 12px;
}
.stat-item { text-align: center; color: #fff; }
.stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-label { font-size: .78rem; opacity: .8; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .content-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column; align-items: stretch;
    padding: 12px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 16px; border-radius: var(--radius-sm); }
  .menu-toggle { display: flex; }
  .hero { padding-top: 40px; }
  .input-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .tool-body { padding: 20px; }
  .btn-row { flex-direction: column; }
  .btn-primary { flex: auto; }
  .content-sidebar { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 20px; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats-inner { gap: 20px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .benefits { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .footer-main { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .custom-scale-grid { grid-template-columns: 1fr 1fr; }
  .share-row { flex-direction: column; align-items: flex-start; }
  .tool-tabs { overflow-x: auto; }
  .tool-tab { font-size: .82rem; padding: 14px 12px; white-space: nowrap; }
}

/* === UTILITIES === */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* === PRINT === */
@media print {
  .site-header, .site-footer, .ad-banner, .theme-toggle, .btn-row, .share-row { display: none !important; }
  .tool-card { box-shadow: none; border: 1px solid #ccc; }
  body { color: #000; background: #fff; }
}
