/* «Смета» for the client (app/estimate_pages.py): one sheet on the phone's width — the lines with a tick each, the
   chosen total in the mono figures, «Согласовать выбранное» the one lime of the screen; and the printable view for
   the заказ-наряд. The tokens are brand.css's. */
.estimate-page {
  background: var(--paper);
}
.est-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.est-head h1 {
  font-size: clamp(26px, 6vw, 34px);
  margin: 4px 0 8px;
}
.est-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 20px;
}
.est-nav .btn {
  min-height: 44px;
}
.est-print-only {
  display: none;
}
.est-car {
  white-space: nowrap;
}
.est-company,
.est-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.est-company {
  font-weight: 600;
  color: var(--ink);
}
.est-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ok-tint);
  color: var(--ok);
}
.est-notice.warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.est-notice a {
  font-weight: 650;
}
.est-sheet {
  margin-top: 20px;
  padding: 18px 16px;
  border: 1px solid var(--card-edge);
  border-radius: var(--card-radius);
  background: var(--sheet);
  box-shadow: var(--card-shadow);
}
.est-lead {
  margin: 0 0 12px;
  font-weight: 600;
}
.est-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.est-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}
.est-line:first-child {
  border-top: 0;
}
.est-pick {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.est-pick input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--forest);
}
.est-what {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* A line without a sum has no tick: its words stand where the ticked lines' words do. */
.est-line.later .est-what {
  padding-left: 34px;
}
.est-pick,
.est-what {
  font-size: 16px;
}
.est-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}
.est-kind,
.est-note {
  color: var(--muted);
  font-size: 14px;
}
.est-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}
.est-price.words {
  max-width: 9em;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  white-space: normal;
}
.est-said {
  grid-column: 2;
  justify-self: end;
  font-size: 14px;
  font-weight: 600;
}
.est-line.yes .est-said {
  color: var(--ok);
}
.est-line.no .est-said {
  color: var(--error);
}
.est-line.no .est-title {
  color: var(--muted);
}
.est-photo {
  grid-column: 1 / -1;
  width: max-content;
}
.est-photo img {
  display: block;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-edge);
}
.est-total {
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
}
.est-total b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.est-remark,
.est-fine {
  color: var(--muted);
  font-size: 14px;
}
.est-consent,
.est-paid {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ok-tint);
  color: var(--ok);
  font-weight: 600;
}
.est-actions {
  display: grid;
  gap: 10px;
  margin: 16px 0 8px;
}
.est-actions .btn {
  width: 100%;
}
@media (min-width: 600px) {
  .est-main {
    padding-top: 40px;
  }
  .est-sheet {
    padding: 24px;
  }
  .est-actions {
    grid-template-columns: auto auto;
    justify-content: start;
  }
  .est-actions .btn {
    width: auto;
  }
}

/* The printable view: black on white, the table ruled, nothing to tap. */
.estimate-print {
  background: var(--sheet);
}
.est-print {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  font-size: 14px;
}
.est-print h1 {
  font-size: 24px;
}
.est-print table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.est-print :is(td, th) {
  border: 1px solid var(--rule);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.est-print .num {
  font-family: var(--mono);
  white-space: nowrap;
  text-align: right;
}
.est-sign {
  margin-top: 40px;
}
@media print {
  .est-noprint,
  .est-nav,
  .estimate-page .est-actions,
  .estimate-page #pay,
  .estimate-page .est-lead,
  .estimate-page [data-estimate] > .est-fine,
  .estimate-page [data-estimate] > .est-total:not(.est-print-only),
  .estimate-page input {
    display: none;
  }
  .estimate-page .est-print-only {
    display: block;
  }
  .estimate-page {
    background: #fff;
    color: #000;
  }
  .est-main {
    max-width: none;
    padding: 0;
  }
  .est-sheet {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .est-line,
  .est-consent,
  .est-total {
    break-inside: avoid;
  }
  .est-line.later .est-what {
    padding-left: 0;
  }
  .estimate-page a {
    color: inherit;
    text-decoration: none;
  }
  .est-print {
    padding: 0;
  }
}
