<!DOCTYPE html>
<html lang="en">
$_head()$

<body class="doc-letter$if(numbering)$ numbered$endif$">
  <!-- Letter layout: single column, no TOC sidebar -->
  <main class="content-wrapper" role="main">
    <div class="content-page">
      <!-- Letterhead -->
      <header class="document-header">
        <div class="header-content">
          $if(client)$$if(project)$
          <div class="header-line client-project">
            $client$ - $project$$if(project_number)$ ($project_number$)$endif$
          </div>
          $endif$$endif$
          $if(title)$
          <div class="document-title">$title$</div>
          $endif$
          <div class="document-meta">
            $if(date)$<span class="date">$date$</span>$endif$
            $if(tracking_number)$<span class="tracking-number">$tracking_number$</span>$endif$
            $if(revision)$<span class="revision">Revision: $revision$</span>$endif$
            $if(status)$<span class="status">Status: $status$</span>$endif$
          </div>
        </div>
      </header>

      <!-- Print-only header -->
      <div class="print-header">
        $if(custom_header)$
        $custom_header$
        $else$
        $if(client)$$if(project)$
        <div class="header-line client-project">$client$ - $project$$if(project_number)$ ($project_number$)$endif$</div>
        $endif$$endif$
        $if(title)$<div class="header-line document-title">$title$</div>$endif$
        $endif$
      </div>

      <!-- Print-only footer -->
      <div class="print-footer">
        <div class="footer-left">
          $if(tracking_number)$$tracking_number$$endif$$if(revision)$ Revision: $revision$$endif$$if(status)$ Status: $status$$endif$
        </div>
        <div class="footer-right">Page <span class="page-number"></span></div>
      </div>

      <article class="document-content">
        $body$
      </article>
    </div>
  </main>
$_scripts()$
</body>
</html>
