/*
 * The Indicative Property Analysis: print layout.
 *
 * A letter, not a dashboard. It runs to two or three A4 pages by design, unlike the one
 * page summary which is fixed to one, because this is the considered document rather
 * than the mailer.
 *
 * THE THREE FIELD STATES ARE THE POINT OF THIS STYLESHEET.
 *
 *   tz-s-filled     the tool knows it            plain black text
 *   tz-s-evidence   the tool knows what informs it, not the answer
 *   tz-s-blank      the tool cannot know it
 *
 * The last two carry a left rule and a write-on line ON SCREEN so the operator can see
 * at a glance what still needs him. In PRINT those cues stay, because a printed draft
 * he is checking needs them more than the screen does, and the final version is only
 * printed once every blank is filled.
 */

:root {
  /* His brand green, sampled from the logo in his own template. */
  --tz-green: #3d8739;
  --tz-ink: #1a1a1a;
  --tz-mid: #555;
  --tz-rule: #d8d8d8;
  --tz-amber: #b8860b;
}

.tz {
  background: #fff;
  color: var(--tz-ink);
  font: 400 11pt/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  max-width: 190mm;
  margin: 0 auto;
  padding: 14mm 16mm;
  box-sizing: border-box;
}

/* ------------------------------------------------------------------ header */
.tz-head { margin-bottom: 10mm; }
.tz-brand { display: flex; align-items: center; gap: 4mm; }
.tz-logo { width: 18mm; height: auto; display: block; }
.tz-name {
  font-size: 20pt; font-weight: 700; color: var(--tz-green);
  letter-spacing: -.01em; line-height: 1;
}
.tz-strap {
  font-size: 7.5pt; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--tz-ink); margin-top: 1mm;
}
.tz-addressee { margin: 0; font-weight: 700; }
.tz-date { margin: 0 0 8mm; color: var(--tz-mid); }

.tz-h1 {
  font-size: 13pt; color: var(--tz-green); margin: 0 0 4mm;
  border-bottom: 2px solid var(--tz-green); padding-bottom: 1.5mm;
}
.tz-h2 {
  font-size: 11.5pt; color: var(--tz-green); margin: 8mm 0 3mm;
  page-break-after: avoid;
}

/* ------------------------------------------------------------------ fields */
.tz-info { display: block; }
.tz-field {
  display: block; padding: 1.6mm 0 1.6mm 3mm;
  border-left: 3px solid transparent;
  page-break-inside: avoid;
}
.tz-label { font-weight: 700; margin-right: 1.5mm; }
.tz-value { }
/* The write-on rule for an empty value. Never an empty gap, which reads as "none". */
.tz-blank {
  display: inline-block; min-width: 60mm;
  border-bottom: 1px solid var(--tz-mid);
}
.tz-note {
  display: block; font-size: 8.5pt; color: var(--tz-mid);
  margin-top: .8mm; font-style: italic;
}

/* State cues. Green means the tool answered it; amber means it still needs a person. */
.tz-s-filled { border-left-color: var(--tz-green); }
.tz-s-evidence { border-left-color: var(--tz-amber); background: #fdfaf2; }
.tz-s-blank { border-left-color: var(--tz-amber); background: #fdfaf2; }

.tz-controls { margin: 1mm 0 0; padding-left: 5mm; }
.tz-controls li { margin: .4mm 0; }
.tz-qm { color: var(--tz-mid); }
.tz-none { color: var(--tz-mid); font-style: italic; }

/* ------------------------------------------------- development standards */
.tz-table {
  width: 100%; border-collapse: collapse; margin: 3mm 0 2mm;
  font-size: 8.5pt; page-break-inside: avoid;
}
.tz-table th, .tz-table td {
  border: 1px solid #9aab8f; padding: 1.5mm 1.8mm; text-align: center;
  vertical-align: middle;
}
/* His own table is a pale green header block; this reproduces it as real text. */
.tz-table thead th { background: #e9efe3; font-weight: 700; line-height: 1.25; }
.tz-rowhead { background: #e9efe3; text-align: left; font-weight: 700; white-space: nowrap; }
.tz-this-zone td, .tz-this-zone .tz-rowhead {
  background: #d3e8c6; font-weight: 700;
}
.tz-caption { font-size: 8.5pt; color: var(--tz-mid); margin: 1mm 0 0; font-style: italic; }

/* --------------------------------------------------------------- conclusion */
.tz-para { margin: 0 0 3mm; text-align: justify; }
.tz-yes { color: var(--tz-green); }
.tz-no { color: #a33; }
.tz-issues { margin: 0 0 2mm; padding-left: 6mm; }
.tz-issues li { margin: 1mm 0; }
.tz-warn { color: var(--tz-amber); }
/* A blank bullet to write the next issue on. */
.tz-todo::after {
  content: ""; display: inline-block; min-width: 90mm;
  border-bottom: 1px solid var(--tz-mid);
}

/* ------------------------------------------------------------------- footer */
.tz-foot { margin-top: 8mm; padding-top: 4mm; border-top: 1px solid var(--tz-rule); }
.tz-small { font-size: 8.5pt; color: var(--tz-mid); margin: 0 0 2.5mm; }
.tz-sign { margin: 0; }

/* Provenance is an operator note, so it is on screen and never on paper. */
.tz-prov {
  margin: 6mm 0 0; padding: 2.5mm 3mm;
  background: #f2f4f7; border-radius: 3px;
  font-size: 8.5pt; color: var(--tz-mid);
}

/* ------------------------------------------------------------------ on screen */
.tz-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 22, 26, .55);
  display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 20px;
}
.tz-panel {
  background: #fff; border-radius: 8px; width: min(230mm, 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.tz-head-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--tz-rule);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 8px 8px 0 0;
}
.tz-head-bar h2 { margin: 0; font-size: 15px; }
.tz-head-bar .grow { flex: 1; }

/* --------------------------------------------------------------------- print */
@media print {
  /*
   * NO `body > *:not(.tz-backdrop)` RULE HERE, deliberately.
   *
   * Two such rules in different stylesheets are mutually exclusive: each hides the
   * other's container, so together they hide the whole document and every print comes
   * out blank. That has already happened once on this project, between the one page
   * summary and the mail run, and it is invisible on screen. The single combined
   * selector lives in onepager.css and now names .tz-backdrop too.
   */
  .tz-backdrop {
    position: static; background: none; padding: 0; display: block; overflow: visible;
  }
  .tz-panel { box-shadow: none; width: auto; border-radius: 0; }
  .tz-head-bar { display: none !important; }
  .tz-prov { display: none !important; }
  .tz { padding: 0; max-width: none; }
  @page { size: A4; margin: 14mm 16mm; }
}

/* The third verdict: divides on area, the driveway is what stops it. Neither a yes
   nor a no, and it must not read as either. */
.tz-maybe { color: var(--tz-amber); }
.tz-key { font-weight: 650; }

/* ----------------------------------------------------------- editable fields */
/*
 * Every value is typed into directly. On screen the editable area shows a faint
 * underlay so it is obviously a field; on paper that disappears and it is just text.
 */
.tz-value {
  outline: none;
  border-radius: 2px;
  padding: 0 2px;
  min-width: 2em;
  display: inline-block;
}
.tz-value:hover { background: #f4f6f8; }
.tz-value:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--tz-green);
}

/* A draft the tool wrote and he has not yet accepted. */
.tz-draft .tz-value { background: #fff8e6; }
.tz-tag {
  margin-left: 6px; padding: 1px 6px;
  border: 1px solid var(--tz-amber); border-radius: 999px;
  background: #fff8e6; color: var(--tz-amber);
  font-size: 7.5pt; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer; vertical-align: 1px;
}
.tz-tag:hover { background: var(--tz-amber); color: #fff; }
.tz-accepted { border-left-color: var(--tz-green) !important; background: none !important; }

@media print {
  .tz-value:hover, .tz-value:focus { background: none; box-shadow: none; }
  .tz-draft .tz-value { background: none; }
  /*
   * AN UNACCEPTED DRAFT STILL PRINTS ITS MARK.
   *
   * A sentence the tool wrote and he never read must not be able to leave the office
   * looking like something he said. Accepting is one click, or one keystroke of
   * editing, so the friction is trivial; a wrong proposal on his letterhead is not.
   */
  .tz-tag {
    display: inline !important;
    border: 0; background: none; color: #000;
    font-size: 8pt; text-transform: none; letter-spacing: 0;
  }
  .tz-tag::before { content: "[unchecked draft: "; }
  .tz-tag::after { content: "]"; }
}

/* ------------------------------------------------------------------- aerial */
/*
 * Reuses .op-parcel from onepager.css for the boundary stroke, so the line looks the
 * same on the letter and on this document. Two definitions would drift.
 */
.tz-aerial { margin: 0 0 8mm; page-break-inside: avoid; }
.tz-aerial-wrap { position: relative; width: 100%; overflow: hidden; border-radius: 3px; }
.tz-aerial-wrap img { display: block; width: 100%; height: auto; }
.tz-aerial-wrap .op-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.tz-aerial figcaption {
  margin-top: 1.5mm; font-size: 8pt; color: var(--tz-mid); line-height: 1.35;
}
@media print {
  .tz-aerial-wrap img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
