/* Shared interface rhythm. Exported documents retain their own styles. */
@media screen {
  :root { --control-radius: 3px; --control-height: 52px; --control-size: 15px; }
  body .button:not(.button--small),
  body:is(.home-page,.profile-page) .hero__actions .button,
  body:is(.home-page,.profile-page) .consultation-fees .line-card .line-booking,
  .document-tool-page :is(.page-actions,.interview-actions,.actions) button {
    min-height: var(--control-height); max-width: 100%; padding: 13px 20px;
    border-radius: var(--control-radius); font-size: var(--control-size);
    font-weight: 600; line-height: 1.5; letter-spacing: 0;
    align-items: center; justify-content: center; gap: 12px; text-align: center;
  }
  body:is(.home-page,.profile-page) .hero__actions .button--secondary {
    border: 1px solid #9bafa3; background: transparent; color: #183c34;
  }
  body:is(.home-page,.profile-page) .hero__actions { gap: 12px; }
  body:is(.home-page,.profile-page) .hero .lead {
    font-size: 16px; line-height: 1.95; margin-bottom: 24px;
  }
  body .button.document-tool-button,
  body:is(.home-page,.profile-page) .consultation-fees .line-card .line-booking { justify-content: space-between; }
  .document-tool-page :is(#pageNext,#generateDraft,.interview-next) { font-weight: 600; }
  body .button--primary:hover,
  body .document-tool-button:hover,
  body:is(.home-page,.profile-page) .consultation-fees .line-card .line-booking:hover,
  .document-tool-page :is(#pageNext,#generateDraft,#downloadPdf):hover:not(:disabled) { background: #15372c; border-color: #15372c; color: #fffdf4; }
  body .button:focus-visible,
  body .line-booking:focus-visible,
  body .menu-toggle:focus-visible,
  .document-tool-page :is(button,.export-files a):focus-visible {
    outline: 3px solid #846443; outline-offset: 4px; box-shadow: none;
  }
  body .menu-toggle { border-radius: var(--control-radius); font-size: 14px; font-weight: 500; line-height: 1.5; }
  .home-page .document-tool-grid > article { display: flex; flex-direction: column; gap: 12px; }
  .home-page .document-tool-grid h3 { margin: 0; font-size: 24px; line-height: 1.5; }
  .home-page .document-tool-grid > article > p:not(.document-tool-action) { margin: 0; font-size: 15px; line-height: 1.9; color: #59645c; }
  .home-page .document-tool-grid .document-tool-action { margin: auto 0 0; padding-top: 12px; }
  .home-page .tool-panel { padding: 28px; }
  .home-page .tool-panel label { font-size: 15px; font-weight: 600; line-height: 1.6; }
  .home-page .tool-panel .field-grid { gap: 20px 16px; }
  .home-page .tool-panel .field-grid label { margin: 0; }
  .home-page .tool-panel .form-block { margin-bottom: 24px; }
  .home-page .tool-panel .form-block h3 { margin: 0 0 16px; padding-bottom: 12px; font-size: 18px; line-height: 1.6; }
  .home-page .tool-panel > label { margin: 24px 0 0; }
  .home-page .tool-panel :is(input,select,textarea),
  .document-tool-page .group-field :is(input,select,textarea) { min-height: 50px; font-size: 16px; font-weight: 400; line-height: 1.5; border-color: #b0bcb0; border-radius: 3px; }
  .home-page .tool-panel :is(input,select,textarea):focus-visible,
  .document-tool-page .group-field :is(input,select,textarea):focus-visible { outline: 2px solid #846443; outline-offset: 3px; box-shadow: none; }
  .document-tool-page .group-fields { max-width: none; gap: 20px 16px; }
  .document-tool-page .book-page { padding: 32px; }
  .document-tool-page .book-page h2 { margin-bottom: 24px; text-wrap: balance; }
  .home-page .tool-actions,
  .document-tool-page :is(.page-actions,.interview-actions,.actions) {
    gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #d8d8cb;
  }
  @media (max-width: 900px) {
    .site-header .topbar, header.topbar, .document-tool-page .law-site-nav { min-height: 80px; }
  }
  @media (max-width: 600px) {
    body:is(.home-page,.profile-page) .hero__actions { gap: 12px; }
    body:is(.home-page,.profile-page) .hero__actions .button { width: 100%; }
    body .menu-toggle { padding: 10px 14px; min-height: 44px; }
    .home-page .tool-panel, .document-tool-page .book-page { padding: 24px 20px; }
    .home-page .document-tool-grid h3 { font-size: 22px; }
    .home-page .generator-disclosure .generator__layout { padding: 20px; }
    .home-page .generator-disclosure :is(.tool-panel,.template-panel) { padding: 0; border: 0; background: transparent; }
    body:is(.home-page,.profile-page) .consultation-fees .line-card .line-booking { min-height: 54px; }
    .document-tool-page .page-actions button { flex: 1 1 90px; }
  }
  @media (max-width: 360px) { body .menu-toggle { padding-inline: 10px; } }
}

/* Keep missing-field and download feedback next to the current action. */
@media screen {
  .home-page .tool-panel [aria-invalid="true"] { border-color: #9a2d22; background: #fffaf7; }
  .home-page .tool-panel .field-error { display: block; margin: 0; color: #9a2d22; font-size: 13px; font-weight: 400; line-height: 1.7; }
  .home-page .tool-panel .copy-status:empty { display: none; }
  .home-page .tool-panel .copy-status:not(:empty) { margin: 16px 0 0; padding: 12px 14px; border-left: 2px solid currentColor; background: #eeece4; font-size: 14px; font-weight: 500; line-height: 1.8; }
  .home-page .tool-panel .copy-status[data-state="info"] { color: #183c34; }
}

/* Keep generated file choices readable and visible with their result message. */
@media screen {
  .document-tool-page .export-feedback { margin-top: 16px; padding: 16px; border-left: 2px solid currentColor; background: #eeece4; color: #183c34; }
  .document-tool-page .export-feedback:not([data-state]) { display: none; }
  .document-tool-page .export-feedback[data-state="error"] { color: #9a2d22; }
  .document-tool-page .export-feedback[data-state="warning"] { color: #765324; }
  .document-tool-page .export-feedback .export-status { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.8; overflow-wrap: anywhere; }
  .document-tool-page .export-feedback .export-files { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
  .document-tool-page .export-feedback .export-files:empty { display: none; }
  .document-tool-page .export-feedback .export-files a { justify-content: center; min-height: 52px; padding: 12px; border: 1px solid #183c34; border-radius: 3px; background: #fffefb; color: #183c34; font-size: 15px; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; }
  .document-tool-page .export-feedback .export-files a:hover { background: #183c34; color: #fffefb; }
  @media (max-width: 600px) { .document-tool-page .export-feedback .export-files { grid-template-columns: minmax(0,1fr); } }
}

/* Keep form targets still while moving between inputs and download actions. */
@media screen {
  html:has(#letterForm:focus-within, #agreementForm:focus-within) { scroll-behavior: auto; }
}
