/* En-tête et navigation */
.top-app-bar { position: relative; }
.tool-navigation { gap: 4px; }
.nav-group { position: relative; display: inline-flex; align-items: center; }
.nav-link { padding: 8px 12px; border-radius: var(--radius-full); color: var(--on-surface-variant); font-size: 13px; font-weight: 700; text-decoration: none; }
.nav-link:hover, .nav-link:focus-visible, .nav-link[aria-current="page"] { color: var(--on-primary-container); background: var(--primary-container); }
.nav-chevron { width: 28px; height: 28px; margin-left: -6px; padding: 0; color: var(--on-surface-variant); background: transparent; border: 0; border-radius: 50%; font-size: 13px; cursor: pointer; }
.nav-chevron:hover { background: var(--surface-container); }
.nav-menu { position: absolute; top: 100%; left: 0; z-index: 20; min-width: 220px; margin: 6px 0 0; padding: 8px; list-style: none; background: var(--surface); border: 1px solid var(--outline-variant); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.nav-menu[hidden] { display: none; }
.tool-navigation .nav-menu a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--on-surface); font-size: 14px; font-weight: 600; }
.tool-navigation .nav-menu a:hover, .tool-navigation .nav-menu a:focus-visible { color: var(--on-primary-container); background: var(--primary-container); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; place-items: center; margin-left: auto; }
  .tool-navigation { display: none; overflow: visible; flex-direction: column; align-items: stretch; order: 3; width: 100%; padding-bottom: 8px; }
  .tool-navigation.is-open { display: flex; }
  .nav-group { flex-wrap: wrap; justify-content: space-between; }
  .nav-link { flex: 1; }
  .nav-menu { position: static; width: 100%; margin: 4px 0 8px; box-shadow: none; }
  .top-actions { order: 2; }
}

/* Fil d'Ariane, réassurance, contenu SEO */
.trust-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.trust-pills li { padding: 8px 14px; color: var(--on-primary-container); background: var(--primary-container); border-radius: var(--radius-full); font-size: 13px; font-weight: 650; }
.breadcrumbs { margin-bottom: 18px; color: var(--on-surface-variant); font-size: 13px; }
.breadcrumbs a { color: var(--on-surface-variant); }
.seo-content { max-width: 820px; margin: 64px auto 0; }
.seo-content h2 { margin: 40px 0 14px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; }
.seo-content p { color: var(--on-surface-variant); line-height: 1.65; }
.steps-list { display: grid; gap: 12px; padding: 0; counter-reset: step; list-style: none; }
.steps-list li { counter-increment: step; display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface-container); border-radius: var(--radius-md); }
.steps-list li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 32px; height: 32px; color: var(--on-primary); background: var(--primary); border-radius: 50%; font-weight: 700; }
.faq details { margin-bottom: 10px; padding: 14px 18px; background: var(--surface-container); border-radius: var(--radius-md); }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 10px 0 0; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.related-links a { display: inline-block; padding: 9px 16px; color: var(--on-primary-container); background: var(--primary-container); border-radius: var(--radius-full); font-size: 14px; font-weight: 650; text-decoration: none; }
.related-links a:hover { background: var(--surface-high); }

/* Accueil */
.tool-home .tool-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 18px; }
.tool-home .tool-card, .tool-home .tool-card:first-child { grid-row: auto; flex-direction: row; align-items: center; justify-content: flex-start; min-height: 120px; background: var(--surface-container); }
.tool-home .tool-card:hover, .tool-home .tool-card:first-child:hover { background: var(--surface-high); }
.home-section-title { margin: 44px 0 0; font-size: 22px; letter-spacing: -.03em; }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.why-card { padding: 22px; background: var(--surface-container); border-radius: var(--radius-lg); }
.why-card strong { display: block; margin-bottom: 8px; font-size: 18px; }
.why-card p { margin: 0; color: var(--on-surface-variant); line-height: 1.55; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.chip-list a { display: inline-block; padding: 9px 16px; color: var(--on-primary-container); background: var(--primary-container); border-radius: var(--radius-full); font-size: 14px; font-weight: 650; text-decoration: none; }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

/* Pied de page */
.site-footer { display: block; max-width: 1120px; padding: 48px 28px 38px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid strong { display: block; margin-bottom: 12px; color: var(--on-surface); font-size: 14px; }
.footer-grid ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-grid a { color: var(--on-surface-variant); text-decoration: none; }
.footer-grid a:hover, .footer-grid a:focus-visible { color: var(--primary); text-decoration: underline; }
.footer-grid p { max-width: 32ch; margin: 0; line-height: 1.5; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--outline-variant); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* Pages légales */
.legal-content { max-width: 760px; margin: 20px auto 0; line-height: 1.7; }
.legal-content h1 { font-size: clamp(32px, 5vw, 46px); }
.legal-content h2 { margin: 34px 0 10px; font-size: 22px; letter-spacing: -.02em; }
.legal-content p, .legal-content li { color: var(--on-surface-variant); }
.legal-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.legal-content th, .legal-content td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--outline-variant); }

/* Deux états : dropzone puis espace de travail */
.panel-title { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.options-panel { padding: 18px; background: var(--surface); border-radius: var(--radius-md); }
.conversion-controls.options-panel { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.options-panel .pdf-layout-fields { grid-template-columns: 1fr; margin: 0; }
.options-panel .pdf-action-row { margin: 16px 0 0; }

#tool-root[data-state="empty"] :is(.file-area, .result-actions, .options-panel, .batch-progress, .progress-summary) { display: none; }
#tool-root[data-state="workspace"] .trust-pills { display: none; }
#tool-root[data-state="workspace"] .hero { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#tool-root[data-state="workspace"] .source-panel { min-height: 0; }
#tool-root[data-state="workspace"] .drop-zone { flex-direction: row; gap: 14px; min-height: 0; padding: 14px 18px; }
#tool-root[data-state="workspace"] .drop-zone h2 { margin: 0; font-size: 15px; }
#tool-root[data-state="workspace"] .drop-zone p { margin: 0; }
#tool-root[data-state="workspace"] :is(.drop-icon, .drop-hint) { display: none; }

@media (min-width: 900px) {
  #tool-root[data-state="workspace"] .converter-surface { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 20px; align-items: start; }
  #tool-root[data-state="workspace"] .converter-surface > * { grid-column: 1; }
  #tool-root[data-state="workspace"] .converter-surface > .options-panel { grid-column: 2; grid-row: 1 / span 5; position: sticky; top: 16px; }
  #tool-root[data-state="workspace"] .converter-surface > .result-actions { grid-column: 2; grid-row: 6; flex-direction: column; align-items: stretch; }
  #tool-root[data-state="workspace"] .converter-surface > .privacy-note { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
  #tool-root[data-state="workspace"] .options-panel .convert-button,
  #tool-root[data-state="workspace"] #merge-pdf-button { position: sticky; bottom: 12px; z-index: 5; }
}
