/* =========================================
   Elektrik Tüketim Hesaplayıcı — Premium CSS
   Senior Frontend Developer Quality
   ========================================= */

:root {
  --bg: #f7f8fc;
  --bg-alt: #eef0f6;
  --bg-glass: rgba(255,255,255,.72);
  --card: #ffffff;
  --card-hover: #fafbff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #9ca3af;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --accent: #059669;
  --accent-hover: #047857;
  --accent-light: rgba(5,150,105,.08);
  --accent-glow: rgba(5,150,105,.18);
  --accent2: #0891b2;
  --accent2-hover: #0e7490;
  --accent2-light: rgba(8,145,178,.08);
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --gradient: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  --gradient-soft: linear-gradient(135deg, rgba(5,150,105,.06) 0%, rgba(8,145,178,.06) 100%);
  --gradient-hero: linear-gradient(160deg, #ecfdf5 0%, #f0fdfa 30%, #ecfeff 60%, #f0f9ff 100%);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md: 0 8px 25px -5px rgba(0,0,0,.08), 0 4px 10px -6px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 40px -12px rgba(0,0,0,.12);
  --shadow-accent: 0 4px 14px rgba(5,150,105,.25);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 9999px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: .35s cubic-bezier(.4,0,.2,1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", SFMono-Regular, Consolas, monospace;
  --max-w: 1200px;
  --header-h: 68px;
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

[data-theme="dark"] {
  --bg: #0c1222;
  --bg-alt: #151d30;
  --bg-glass: rgba(15,23,42,.82);
  --card: #1a2332;
  --card-hover: #1f2b3d;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --border: #2a3548;
  --border-hover: #374151;
  --accent-light: rgba(5,150,105,.12);
  --accent-glow: rgba(5,150,105,.22);
  --accent2-light: rgba(8,145,178,.12);
  --danger-light: rgba(220,38,38,.1);
  --warning-light: rgba(217,119,6,.1);
  --success-light: rgba(22,163,74,.1);
  --gradient-soft: linear-gradient(135deg, rgba(5,150,105,.08) 0%, rgba(8,145,178,.08) 100%);
  --gradient-hero: linear-gradient(160deg, #0c1222 0%, #111b2e 40%, #0f1d2d 100%);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
  --shadow: 0 4px 6px rgba(0,0,0,.3);
  --shadow-md: 0 8px 25px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.45);
  --shadow-accent: 0 4px 14px rgba(5,150,105,.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent-glow); color: var(--accent-hover); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
strong { color: var(--text); font-weight: 600; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================================
   HEADER — Glassmorphism + Sticky
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  backdrop-filter: blur(16px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

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

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.015em;
}
.site-logo:hover { color: var(--accent); text-decoration: none; }

.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem; flex-shrink: 0;
  box-shadow: var(--shadow-accent);
  transition: transform var(--transition);
}
.site-logo:hover .logo-icon { transform: scale(1.08) rotate(-3deg); }

.main-nav { display: flex; align-items: center; gap: .125rem; }
.main-nav a {
  padding: .5rem .875rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}
.main-nav a:hover,
.main-nav a.active { color: var(--accent); background: var(--accent-light); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: .5rem; }

.theme-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }

.mobile-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 1.15rem;
  align-items: center; justify-content: center;
}

/* ============================================
   LAYOUT
   ============================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }
main { flex: 1; padding: 2.5rem 0; }

/* ============================================
   HERO — Animated gradient background
   ============================================ */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
  background: var(--gradient-hero);
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroPulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(8,145,178,.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroPulse 8s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

@keyframes heroPulse {
  from { transform: scale(1) translate(0, 0); opacity: .6; }
  to { transform: scale(1.15) translate(10px, -10px); opacity: 1; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem 1rem;
  background: var(--accent-light);
  border: 1px solid rgba(5,150,105,.15);
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -.03em;
  position: relative;
  z-index: 1;
}

.hero h1 .accent { color: var(--accent); }
.hero h1 .accent2 { color: var(--accent2); }

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  line-height: 1.75;
}

.hero .disclaimer {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.75rem;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hero-stat .label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .125rem;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.breadcrumb li + li::before { content: "›"; margin-right: .25rem; color: var(--border); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }

/* ============================================
   CARDS — Elevated glass style
   ============================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-slow);
  position: relative;
}

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

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

.card-sm { padding: 1.25rem; border-radius: var(--radius-sm); }

.card-link { display: block; color: var(--text); text-decoration: none; }
.card-link:hover { text-decoration: none; color: var(--text); }
.card-link h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
  transition: color var(--transition);
}
.card:hover .card-link h3,
.card-link:hover h3 { color: var(--accent); }
.card-link p { font-size: .875rem; color: var(--text-secondary); line-height: 1.65; }

.card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  margin-bottom: .875rem;
  transition: transform var(--transition);
}
.card:hover .card-icon { transform: scale(1.1); }
.card-icon.green { background: var(--accent-light); }
.card-icon.blue { background: var(--accent2-light); }

.card-arrow {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  color: var(--muted);
  transition: all var(--transition);
}
.card:hover .card-arrow { background: var(--accent); color: #fff; transform: translateX(3px); }

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: .25rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: .3rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: .625rem 1.25rem;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  position: relative;
}
.tab-btn.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FORMS — Refined inputs
   ============================================ */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .375rem;
  letter-spacing: .01em;
}
.form-group small { display: block; font-size: .75rem; color: var(--muted); margin-top: .3rem; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .875rem;
}

input[type="text"], input[type="number"], input[type="email"], input[type="search"], textarea, select {
  width: 100%;
  padding: .65rem .925rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--card);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--card);
}
input::placeholder { color: var(--muted); }
input[type="number"] { font-variant-numeric: tabular-nums; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .875rem center;
  padding-right: 2.25rem;
}

.toggle-wrap { display: flex; align-items: center; gap: .75rem; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--ease-spring) .2s;
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: .85rem; color: var(--text-secondary); cursor: pointer; }

/* ============================================
   BUTTONS — With micro-interactions
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(5,150,105,.35); color: #fff; }

.btn-secondary { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.btn-secondary:hover { background: var(--accent2-hover); color: #fff; }

.btn-outline {
  background: var(--card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-white { background: #fff; color: var(--accent); border-color: rgba(255,255,255,.3); font-weight: 700; }
.btn-white:hover { background: #f0fdf4; color: var(--accent-hover); box-shadow: var(--shadow-md); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.btn-xs { padding: .3rem .6rem; font-size: .75rem; border-radius: 6px; }
.btn-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-lg { padding: .85rem 2rem; font-size: .95rem; border-radius: var(--radius-sm); }

/* ============================================
   DEVICE TABLE
   ============================================ */
.device-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.device-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.device-table th {
  text-align: left;
  padding: .7rem .5rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.device-table td {
  padding: .5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.device-table tr { transition: background var(--transition); }
.device-table tr:hover td { background: var(--accent-light); }

.device-table input[type="text"],
.device-table input[type="number"],
.device-table select { padding: .4rem .5rem; font-size: .82rem; min-width: 0; }

.device-table .col-name { min-width: 140px; }
.device-table .col-w { width: 90px; }
.device-table .col-h { width: 80px; }
.device-table .col-d { width: 70px; }
.device-table .col-q { width: 60px; }
.device-table .col-standby { width: 80px; }
.device-table .col-kwh { width: 100px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.device-table .col-cost { width: 100px; font-weight: 700; color: var(--accent2); font-variant-numeric: tabular-nums; }
.device-table .col-actions { width: 40px; text-align: center; }

.remove-row {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--danger-light);
  color: var(--danger);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all var(--transition);
}
.remove-row:hover { background: var(--danger); color: #fff; transform: scale(1.1); }

/* ============================================
   RESULTS — Gradient accent boxes
   ============================================ */
.results-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-box {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.result-box:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.result-box .value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.result-box .unit { font-size: .82rem; color: var(--muted); font-weight: 600; }
.result-box .label { font-size: .75rem; color: var(--text-secondary); margin-top: .3rem; }
.result-box.cost .value { color: var(--accent2); }

/* ============================================
   BAR CHART — Animated fills
   ============================================ */
.bar-chart { margin: 1rem 0; }
.bar-item { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.bar-label {
  width: 130px; flex-shrink: 0;
  font-size: .82rem; font-weight: 600;
  text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track {
  flex: 1; height: 30px;
  background: var(--bg-alt);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--gradient);
  transition: width .6s var(--ease-spring);
  min-width: 3px;
}
.bar-value {
  width: 85px; flex-shrink: 0;
  font-size: .78rem; font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   SECTIONS
   ============================================ */
.section { margin-bottom: 3rem; }
.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: .5rem;
  color: var(--text);
  letter-spacing: -.02em;
}
.section-subtitle {
  font-size: .95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   ARTICLE CONTENT — Typography perfection
   ============================================ */
.article-content { max-width: 780px; }

.article-content h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.025em;
}

.article-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: .875rem;
  color: var(--text);
  letter-spacing: -.015em;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: .5rem;
}

.article-content p { margin-bottom: 1.125rem; color: var(--text-secondary); line-height: 1.85; }

.article-content ul, .article-content ol {
  margin-bottom: 1.125rem;
  padding-left: 1.5rem;
}
.article-content li { margin-bottom: .5rem; color: var(--text-secondary); line-height: 1.75; }

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.75rem 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
}

.article-content code {
  font-family: var(--font-mono);
  background: var(--bg-alt);
  padding: .15rem .45rem;
  border-radius: 5px;
  font-size: .84em;
  border: 1px solid var(--border);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: .88rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-content th, .article-content td {
  padding: .7rem .875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.article-content th {
  background: var(--bg-alt);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-secondary);
}
.article-content tr:hover td { background: var(--accent-light); }

.info-box {
  padding: 1.125rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 1.75rem 0;
  font-size: .9rem;
  line-height: 1.75;
  border: 1px solid var(--border);
}
.info-box.tip { background: var(--success-light); border-left: 4px solid var(--accent); border-color: rgba(5,150,105,.2); }
.info-box.warning { background: var(--warning-light); border-left: 4px solid var(--warning); border-color: rgba(217,119,6,.2); }
.info-box.danger { background: var(--danger-light); border-left: 4px solid var(--danger); border-color: rgba(220,38,38,.2); }

/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-list { max-width: 780px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .625rem;
  overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item:hover { border-color: var(--accent); }
.faq-item.open { border-color: var(--accent); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: .93rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
  gap: 1rem;
}
.faq-question:hover { background: var(--accent-light); }
.faq-question .arrow { transition: transform var(--transition); flex-shrink: 0; font-size: .75rem; }
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-item.open .faq-question { background: var(--accent-light); color: var(--accent); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-answer-inner {
  padding: 0 1.25rem 1.125rem;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.75;
}

/* ============================================
   SEARCH
   ============================================ */
.search-box { position: relative; max-width: 560px; margin: 0 auto 1.5rem; }
.search-box input {
  padding-left: 3rem;
  padding-right: 1rem;
  height: 52px;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}
.search-box input:focus { border-color: var(--accent); }
.search-box .search-icon {
  position: absolute; left: 1.125rem; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 1.1rem;
}

.search-filters { display: flex; justify-content: center; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-chip {
  padding: .4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.filter-chip.active, .filter-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.search-results { max-width: 680px; margin: 0 auto; }
.search-result-item { padding: 1.125rem 1rem; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.search-result-item:hover { background: var(--accent-light); }
.search-result-item h3 { font-size: 1rem; margin-bottom: .25rem; }
.search-result-item h3 a { color: var(--accent); font-weight: 600; }
.search-result-item p { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }
.search-result-item .tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: var(--radius-pill);
  font-size: .7rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--muted);
  margin-top: .375rem;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: .5rem;
}
.toast {
  padding: .875rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  animation: toastIn .35s var(--ease-spring);
  max-width: 380px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(1rem) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot { text-align: center; margin: 2rem 0; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot ins { display: block; width: 100%; }
.ad-inarticle { margin: 2.5rem 0; min-height: 250px; }
.ad-multiplex { margin: 2rem 0; min-height: 200px; }

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  backdrop-filter: blur(16px) saturate(1.8);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cookie-inner {
  max-width: var(--max-w);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cookie-inner p {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.cookie-inner a { color: var(--accent); font-weight: 600; }
.cookie-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }
  .cookie-actions { justify-content: center; }
}

/* ============================================
   FOOTER — Premium structured
   ============================================ */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-top {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.footer-logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}
.footer-top span { font-weight: 700; font-size: .95rem; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  margin-bottom: .875rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .375rem; }
.footer-col a { font-size: .85rem; color: var(--text-secondary); transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }

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

/* ============================================
   LINKS GRID — Pill style
   ============================================ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .625rem;
}
.link-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .84rem;
  font-weight: 500;
  transition: all var(--transition);
}
.link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.link-pill .pill-icon { flex-shrink: 0; }

/* ============================================
   TAGS
   ============================================ */
.tag-list { display: flex; flex-wrap: wrap; gap: .375rem; }
.tag {
  display: inline-block;
  padding: .2rem .625rem;
  border-radius: var(--radius-pill);
  font-size: .7rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--muted);
}
.tag.green { background: var(--accent-light); color: var(--accent); }
.tag.blue { background: var(--accent2-light); color: var(--accent2); }

/* ============================================
   SKIP LINK
   ============================================ */
.skip-link {
  position: absolute;
  top: -100px; left: 0;
  background: var(--accent);
  color: #fff;
  padding: .75rem 1.5rem;
  z-index: 200;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ============================================
   CTA BOX
   ============================================ */
.cta-box {
  background: var(--gradient);
  color: #fff;
  padding: 2.5rem;
  border-radius: var(--radius);
  text-align: center;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: "";
  position: absolute;
  top: -50%; right: -30%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.cta-box h3 { font-size: 1.35rem; margin-bottom: .5rem; position: relative; z-index: 1; }
.cta-box p { opacity: .9; margin-bottom: 1.25rem; position: relative; z-index: 1; }
.cta-box .btn { position: relative; z-index: 1; }

/* ============================================
   404
   ============================================ */
.page-404 { text-align: center; padding: 5rem 1rem; }
.page-404 .big {
  font-size: 7rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.page-404 h1 { font-size: 1.5rem; margin: .75rem 0; }
.page-404 p { color: var(--text-secondary); margin-bottom: 2rem; }

/* ============================================
   FEATURE GRID (Home page)
   ============================================ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.feature-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-slow);
}
.feature-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon {
  width: 56px; height: 56px;
  margin: 0 auto .875rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.feature-item h3 { font-size: .95rem; font-weight: 700; margin-bottom: .375rem; }
.feature-item p { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-toggle { display: flex; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: .5rem;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .hero h1 { font-size: 1.5rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero-stats { gap: 1.25rem; }
  .card-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .result-box .value { font-size: 1.35rem; }
  .bar-label { width: 90px; font-size: .75rem; }
  .bar-value { width: 65px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .device-table { font-size: .78rem; }
  .device-table th, .device-table td { padding: .375rem .25rem; }
  .container { padding: 0 1rem; }
  main { padding: 1.5rem 0; }
  .links-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .tabs { flex-direction: column; }
  .hero-stats { flex-direction: column; gap: .5rem; }
}

/* ============================================
   QUICK CALC WIDGET
   ============================================ */
.quick-calc-section { margin-top: -1rem; }
.quick-calc-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}
.quick-calc-header {
  background: var(--gradient);
  color: #fff;
  padding: 1.25rem 1.5rem;
}
.quick-calc-header h2 { margin: 0; font-size: 1.2rem; }
.quick-calc-header p { margin: .25rem 0 0; opacity: .85; font-size: .9rem; }
.quick-calc-body { padding: 1.5rem; }
.quick-calc-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.qc-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .25rem;
}
.qc-group input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
}
.qc-group input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(5,150,105,.12); }
.quick-calc-result {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.qc-result-row {
  flex: 1; min-width: 180px;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex; flex-direction: column; gap: .25rem;
}
.qc-result-row span { font-size: .8rem; color: var(--text-secondary); }
.qc-result-row strong { font-size: 1.05rem; color: var(--accent); }
.quick-calc-footer {
  padding: 0 1.5rem 1.25rem;
  text-align: right;
}
@media (max-width: 640px) {
  .quick-calc-inputs { grid-template-columns: 1fr 1fr; }
  .quick-calc-inputs .btn { grid-column: 1 / -1; }
}

/* ============================================
   TOPIC CLOUD
   ============================================ */
.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.topic-tag {
  display: inline-block;
  padding: .45rem 1rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s var(--ease-spring);
  white-space: nowrap;
}
.topic-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5,150,105,.2);
}
.topic-tag.topic-hot {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.topic-tag.topic-hot:hover {
  box-shadow: 0 4px 16px rgba(5,150,105,.35);
  transform: translateY(-3px);
}

/* ============================================
   STEPS / HOW IT WORKS
   ============================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.step-card h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
.step-card p { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; margin: 0; }
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; max-width: 400px; margin-left: auto; margin-right: auto; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .site-header, .site-footer, .ad-slot, .btn-group,
  .theme-toggle, .mobile-toggle, .toast-container,
  .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .card, .results-panel { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .hero { background: #f5f5f5; color: #000; }
  .hero::before, .hero::after { display: none; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; color: #666; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
}
