/* Stingray Bookkeeping, client login: statements.html, the real Profit and Loss and Balance Sheet on white paper
   (change 017, the QuickBooks pipe). A page made to be printed or saved as a PDF: white paper, navy ink, our real
   logo, every row of the two statements. On a screen the paper sits on a light gray desk with the Save as PDF button
   above it; in print only the paper is left. Body words 17px and up (readable at arm's length), 18px on a phone. Plain ASCII. */

:root {
  --st-ink: #17283a;
  --st-soft: #4a5a6a;
  --st-rule: #c5ccd3;
  --st-strong-rule: #17283a;
  --st-desk: #e9edf1;
  --st-teal: #1f6f73;
  --st-teal-ink: #ffffff;
  --st-band: #f2f5f7;
  --st-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --st-serif: "Source Serif 4", "Source Serif 4 Plain", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* the door in the head hides the page while the sign-in is checked */
html.guard-wait body {
  visibility: hidden;
}

body {
  margin: 0;
  background: var(--st-desk);
  color: var(--st-ink);
  font: 400 1.0625rem/1.5 var(--st-sans);
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- the bar above the paper */
.st-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.st-back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--st-ink);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.st-save {
  min-height: 52px;
  padding: 10px 26px;
  border: 0;
  border-radius: 12px;
  background: var(--st-teal);
  color: var(--st-teal-ink);
  font: 700 1.125rem/1.2 var(--st-sans);
  cursor: pointer;
}

.st-save:disabled {
  opacity: .55;
  cursor: default;
}

.st-save:focus-visible,
.st-back:focus-visible {
  outline: 3px solid var(--st-ink);
  outline-offset: 3px;
}

.st-help {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 14px;
  color: var(--st-soft);
  font-size: 1.0625rem;
}

/* ---------------------------------------------------------------- loading and trouble */
.st-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.st-state {
  padding: 28px 24px;
  border-radius: 12px;
  background: #ffffff;
  font-size: 1.125rem;
}

.st-problem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

/* ---------------------------------------------------------------- the paper */
.st-paper {
  padding: 48px 56px 40px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(23, 40, 58, .12), 0 8px 28px rgba(23, 40, 58, .10);
}

.st-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--st-strong-rule);
}

.st-logo {
  width: 200px;
  height: auto;
}

.st-head-words {
  flex: 1 1 260px;
  min-width: 0;
}

.st-company {
  margin: 0;
  font: 700 1.5rem/1.25 var(--st-serif);
  overflow-wrap: anywhere;
}

.st-title {
  margin: 4px 0 0;
  font: 600 1.25rem/1.3 var(--st-sans);
}

.st-dates,
.st-basis {
  margin: 4px 0 0;
  color: var(--st-soft);
  font-size: 1.0625rem;
}

.st-statement {
  margin-top: 34px;
}

.st-statement-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--st-rule);
}

.st-statement-title {
  margin: 0;
  font: 700 1.375rem/1.25 var(--st-serif);
}

.st-statement-when {
  margin: 0;
  color: var(--st-soft);
  font-size: 1.0625rem;
}

.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.0625rem;
}

.st-table td {
  padding: 7px 0;
  vertical-align: top;
}

.st-table .st-l {
  padding-right: 20px;
  overflow-wrap: anywhere;
}

.st-table .st-n {
  width: 11em;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* a header row: the name of a group, in bold, with no amount */
.st-row.is-header td {
  padding-top: 14px;
  font-weight: 700;
}

/* a total row: bold, with a rule above it */
.st-row.is-total td {
  border-top: 1px solid var(--st-strong-rule);
  font-weight: 700;
}

/* the very last line of a statement (Net Income, Total Liabilities and Equity): a band under it */
.st-row.is-total.is-top td {
  background: var(--st-band);
}

.st-row.is-total.is-top .st-l {
  padding-left: 10px;
}

.st-row.is-total.is-top .st-n {
  padding-right: 10px;
}

.st-empty {
  margin: 12px 0 0;
  color: var(--st-soft);
}

.st-foot {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--st-rule);
  color: var(--st-soft);
  font-size: 1.0625rem;
}

/* the 15-minute "Still there?" box of portal-api.js, on this plain page */
.idle-warn {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 40, 58, .45);
}

.idle-warn .popup-box {
  max-width: 460px;
  padding: 24px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--st-ink);
}

.idle-warn .h2 {
  margin: 0 0 8px;
  font: 700 1.375rem/1.25 var(--st-serif);
}

.idle-warn .actions {
  margin-top: 16px;
}

.idle-warn .btn {
  min-height: 52px;
  padding: 10px 26px;
  border: 0;
  border-radius: 12px;
  background: var(--st-teal);
  color: var(--st-teal-ink);
  font: 700 1.125rem/1.2 var(--st-sans);
  cursor: pointer;
}

/* ---------------------------------------------------------------- a phone */
@media (max-width: 640px) {
  /* 18px words on a phone (his rule): every row, amount, total, date line, the help line and the foot.
     Print is not touched: the paper of a letter page is wider than 640px, so the PDF keeps 17px */
  body,
  .st-help,
  .st-dates,
  .st-basis,
  .st-statement-when,
  .st-table,
  .st-foot {
    font-size: 1.125rem;
  }

  .st-paper {
    padding: 28px 18px 26px;
  }

  .st-logo {
    width: 160px;
  }

  .st-table .st-n {
    width: auto;
    padding-left: 12px;
  }

  .st-save {
    width: 100%;
  }
}

/* ---------------------------------------------------------------- print and Save as PDF: only the paper */
@page {
  size: letter;
  margin: 0.6in;
}

@media print {
  body {
    background: #ffffff;
  }

  .no-print,
  .idle-warn {
    display: none !important;
  }

  .st-main {
    max-width: none;
    padding: 0;
  }

  .st-paper {
    padding: 0;
    box-shadow: none;
  }

  /* a statement's title never sits alone at the bottom of a page */
  .st-statement-head {
    break-after: avoid;
  }

  .st-row {
    break-inside: avoid;
  }

  .st-row.is-total.is-top td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
