/* ===== Calviro — Apple-épuré, gris/blanc ===== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #71717a;
  --text-soft: #a1a1aa;
  --accent: #18181b;
  --accent-soft: #27272a;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.06);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
  min-height: 100vh;
  padding: 24px 20px 60px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

.container-wide {
  max-width: 1120px;
  margin: 0 auto;
}

/* ===== Header / Nav ===== */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 32px;
}

.brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}

.back:hover { color: var(--text); }

/* ===== Typography ===== */

h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.tagline {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

p { color: var(--text-muted); }

/* ===== Home grid ===== */

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

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.tool-card .icon {
  font-size: 22px;
  margin-bottom: 4px;
  filter: grayscale(0.4);
}

.tool-card .title {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.tool-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-card.soon {
  opacity: 0.55;
  cursor: not-allowed;
}

.tool-card.soon::after {
  content: 'Bientôt';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ===== Tool page layout ===== */

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .tool { padding: 24px 20px; border-radius: var(--radius); }
}

.tool-header {
  margin-bottom: 28px;
}

.tool-header h1 {
  font-size: 28px;
  margin-bottom: 6px;
}

.tool-header p {
  font-size: 15px;
}

/* ===== Form elements ===== */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.005em;
}

input[type="number"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(24,24,27,0.06);
}

input::placeholder { color: var(--text-soft); }

textarea { resize: vertical; min-height: 90px; font-family: 'Geist Mono', monospace; font-size: 13px; }

/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.btn:hover { background: var(--accent-soft); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group .btn { width: auto; flex: 1; min-width: 0; }

/* ===== Tabs / Toggles ===== */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ===== Result block ===== */

.result {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: none;
}

.result.visible { display: block; animation: fadeIn 300ms ease; }

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

.result-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.result-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-family: 'Geist', sans-serif;
  font-feature-settings: 'tnum';
}

.result-value .unit {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.result-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.result-detail-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.result-detail-row strong { color: var(--text); font-weight: 500; font-feature-settings: 'tnum'; }

.note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Pomodoro special ===== */

.timer-display {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(72px, 18vw, 120px);
  font-weight: 500;
  text-align: center;
  letter-spacing: -0.04em;
  margin: 32px 0;
  font-feature-settings: 'tnum';
}

.timer-mode {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

/* ===== Misc ===== */

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
  border: none;
}

.pseudo-output {
  font-family: 'Geist Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  text-align: center;
  padding: 24px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
  word-break: break-all;
  letter-spacing: -0.01em;
}

.subjects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subject-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 10px;
  align-items: center;
}

.subject-row input { padding: 9px 12px; font-size: 14px; }
.subject-row span { font-size: 13px; color: var(--text-muted); }

@media (max-width: 480px) {
  .subject-row { grid-template-columns: 1fr 70px 70px; gap: 8px; }
}

/* ===== SEO content section ===== */

.seo-content {
  max-width: 720px;
  margin: 32px auto 0;
  padding: 0 4px;
}

.seo-content h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 32px 0 12px;
  color: var(--text);
}

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

.seo-content h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 24px 0 8px;
  text-transform: none;
}

.seo-content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: -0.003em;
}

.seo-content p strong { color: var(--text); font-weight: 500; }

.seo-content ul, .seo-content ol {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 16px 20px;
}

.seo-content li { margin-bottom: 6px; }

.seo-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.seo-content th, .seo-content td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.seo-content th {
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.seo-content td { color: var(--text-muted); }

.seo-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.seo-content a:hover { text-decoration-color: var(--text); }

/* ===== Blog ===== */

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.blog-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.blog-card .blog-date {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.blog-card h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}

.blog-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.blog-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .blog-article { padding: 28px 22px; border-radius: var(--radius); }
}

.blog-article .blog-date {
  font-size: 13px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.blog-article h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 24px;
}

.blog-article p, .blog-article ul, .blog-article ol {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}

.blog-article ul, .blog-article ol { margin-left: 20px; }
.blog-article li { margin-bottom: 8px; }

.blog-article h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 12px;
  letter-spacing: -0.02em;
}

.blog-article h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
  text-transform: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.blog-article .cta-tool {
  display: block;
  background: var(--text);
  color: var(--surface);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  margin: 24px 0;
  transition: all var(--transition);
}

.blog-article .cta-tool:hover { background: var(--accent-soft); transform: translateY(-1px); }

/* ===== Footer ===== */

.footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-soft);
}

.footer a { color: var(--text-muted); text-decoration: none; margin: 0 8px; }
.footer a:hover { color: var(--text); }

/* ===========================
   MODE SOMBRE
   =========================== */

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-soft: #71717a;
  --accent: #fafafa;
  --accent-soft: #e4e4e7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.4);
}

html[data-theme="dark"] .brand-dot {
  background: var(--text);
}

html[data-theme="dark"] .tool-card .icon {
  filter: grayscale(0.2) brightness(1.1);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .btn {
  background: var(--text);
  color: var(--bg);
}

html[data-theme="dark"] .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

/* ===========================
   THEME TOGGLE BUTTON
   =========================== */

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  color: var(--text);
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: inline; }
html[data-theme="dark"] .theme-toggle .sun-icon { display: inline; }
html[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* ===========================
   BARRE DE RECHERCHE
   =========================== */

.search-bar {
  position: relative;
  margin: 24px 0 32px;
}

.search-bar input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.05);
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: 0.5;
}

.search-bar input::placeholder {
  color: var(--text-soft);
}

.search-results-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  margin: 20px 0;
  display: none;
}

.search-results-empty.visible { display: block; }

/* ===========================
   CATÉGORIES
   =========================== */

.category-section {
  margin-bottom: 40px;
  scroll-margin-top: 20px;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.category-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.category-count {
  font-size: 13px;
  color: var(--text-muted);
}

.category-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}

.category-pill:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.category-pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ===========================
   HISTORIQUE
   =========================== */

.history-section {
  margin: 24px 0 32px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
}

.history-section.visible { display: block; }

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-clear {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.history-clear:hover {
  background: var(--surface-2);
  color: var(--text);
}

.history-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 600px) {
  .category-nav {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ===========================
   V3 : OUTILS LIÉS
   =========================== */

.related-tools {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-tools h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: all var(--transition);
}

.related-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.related-card .ico {
  font-size: 18px;
  flex-shrink: 0;
}

/* ===========================
   V3 : BOUTONS DE PARTAGE
   =========================== */

.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.share-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ===========================
   V3 : BOUTON "RETOUR HAUT"
   =========================== */

.top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-btn:hover {
  transform: scale(1.05);
}

/* ===========================
   V3 : BANNIÈRE COOKIES
   =========================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px;
  display: none;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.cookie-banner.visible { display: block; }

.cookie-content {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  min-width: 250px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
}

.cookie-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition);
  font-family: inherit;
}

.cookie-btn:hover {
  border-color: var(--border-strong);
}

.cookie-btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ===========================
   V3 : FAQ
   =========================== */

.faq-section {
  margin-top: 48px;
  margin-bottom: 32px;
}

.faq-section h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--surface-2);
}

.faq-question::after {
  content: '+';
  font-size: 24px;
  color: var(--text-muted);
  transition: transform var(--transition);
  font-weight: 300;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  padding: 0 20px 20px;
  max-height: 500px;
}

/* ===========================
   V3 : FAVORIS
   =========================== */

.fav-star {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.3;
  transition: all var(--transition);
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
}

.fav-star:hover {
  opacity: 1;
  background: var(--surface-2);
}

.fav-star.active {
  opacity: 1;
  color: #f59e0b;
}

.tool-card { position: relative; }

/* ===========================
   V3 : ANIMATIONS
   =========================== */

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

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.visible {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Smooth scroll global */
html { scroll-behavior: smooth; }

/* ===========================
   V3 : RESPONSIVE
   =========================== */

@media (max-width: 600px) {
  .top-btn {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .share-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================
   V4 : ONGLETS APPLE STYLE
   =========================== */

.category-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 8px;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.category-tabs::-webkit-scrollbar { display: none; }

html[data-theme="dark"] .category-tabs {
  background: rgba(40, 40, 40, 0.6);
}

.tab-pill {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: -0.01em;
}

.tab-pill:hover {
  color: var(--text);
  background: var(--surface);
}

.tab-pill.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

html[data-theme="dark"] .tab-pill.active {
  background: var(--text);
  color: var(--bg);
}

/* CATEGORY VISIBILITY - 100% CSS basé sur body[data-cat] */
.category-section {
  display: block;
  animation: fadeInSection 0.3s ease-out;
}

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

/* Mode "Tous" : tout visible (par défaut) */
body[data-cat="all"] .category-section,
body:not([data-cat]) .category-section {
  display: block;
}

/* Mode filtré : cache toutes les sections sauf celle qui correspond */
body[data-cat="immobilier"] .category-section:not(#immobilier),
body[data-cat="finance"] .category-section:not(#finance),
body[data-cat="travail"] .category-section:not(#travail),
body[data-cat="sante"] .category-section:not(#sante),
body[data-cat="temps"] .category-section:not(#temps),
body[data-cat="quotidien"] .category-section:not(#quotidien),
body[data-cat="etudes"] .category-section:not(#etudes) {
  display: none;
}

/* Cards plus compactes */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.tool-card {
  padding: 18px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

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

.tool-card .icon {
  font-size: 22px;
  margin-bottom: 6px;
  display: inline-block;
}

.tool-card .title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.tool-card .desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .tool-card {
    padding: 14px 12px;
  }
  
  .tool-card .icon { font-size: 20px; }
  .tool-card .title { font-size: 13px; }
  .tool-card .desc { font-size: 11px; }
}

/* Hero plus Apple */
.hero-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-align: center;
  margin: 16px 0 8px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 14px; }
}

/* Recherche améliorée */
.search-bar input {
  padding: 14px 18px 14px 46px;
  border-radius: 14px;
  font-size: 14px;
}

/* Category header (titre + count) plus discret */
.category-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  padding-left: 4px;
}

.category-header h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.category-count {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

