/* The free tool pages (billable hours chart, timesheet templates, invoice maker, payment reminder
   emails) and the printable timesheets, on top of site.css and article.css.
   Mobile first: laid out at 390 px, holds at 320 px with no sideways scroll; wide tables scroll
   inside their own box. Selectors start with .tool where article.css would otherwise win. */

/* Page frame: text keeps the article measure (44em at 17 px), tools can use the full column. */
.tool { max-width: none; }
.tool > * { max-width: 748px; }
.tool > .wide { max-width: none; }

.tool .lede {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.55;
}
.tool code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--tint);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  overflow-wrap: anywhere;
}
.tool textarea:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
.print-only { display: none; }

/* Form controls. The home page keeps its own in home.css; these stay scoped to the tool pages. */
.tool .input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--field);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}
.tool .select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2314261D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
}
.tool .hint {
  margin: -2px 0 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.4;
}
.tool .optional { color: var(--ink-3); font-weight: 400; }

/* Buttons and links that act like buttons */
.button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--green);
  border-radius: 12px;
  background: var(--white);
  color: var(--green);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}
.button-quiet:hover { background: var(--tint); }
.button-quiet:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 46px;
  padding: 0;
  border: 1.5px solid var(--control);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.icon-button:hover { border-color: var(--ink-3); color: var(--ink); }

/* Billable hours chart */
.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 720px) {
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.tool .chart-grid .table-scroll { margin: 0; }
.chart {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.chart caption {
  padding: 14px 16px 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
}
.chart caption span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 400;
}
.chart th,
.chart td {
  padding: 8px 16px;
  border-top: 1px solid var(--rule-soft);
  text-align: left;
}
.chart thead th { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.chart thead th:last-child { text-align: right; }
.chart tbody th { color: var(--ink-2); font-size: 16px; font-weight: 500; }
.chart tbody td {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  text-align: right;
}
.chart tbody tr:nth-child(even) { background: #F8FAF7; }
.tool .chart-note { margin: 14px 0 0; color: var(--ink-2); font-size: 16px; }
.print-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 14px 0 0;
}
.tool .print-row .button { margin: 0; }
.tool .print-row .fine { flex: 1 1 14em; }

/* Calculator */
.tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 900px) {
  .tool-panel { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; }
  .tool-panel .result-card { position: sticky; top: 16px; }
}
.calc-card {
  min-width: 0;
  padding: 16px;
  border: 1.5px solid var(--control);
  border-radius: 16px;
  background: var(--white);
}
@media (min-width: 420px) { .calc-card { padding: 20px; } }

.choice {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.choice legend {
  margin: 0 0 8px;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border-radius: 12px;
  background: var(--track);
}
.seg label { position: relative; flex: 1 1 auto; }
.seg input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.seg input:checked + span { background: var(--ink); color: var(--white); }
.seg input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }

.tool .bh-entries {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.tool .bh-entry {
  margin: 0;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.bh-set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 4px 8px;
  align-items: end;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bh-times,
.bh-durs { display: contents; }
.bh-form[data-mode="durations"] .bh-times,
.bh-form[data-mode="times"] .bh-durs { display: none; }
.mini-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mini-field > span { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.tool .mini-field .input {
  height: 46px;
  min-width: 0;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}
.mini-field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
}
.tool .bh-entry-out {
  grid-column: 1 / -1;
  min-height: 1.4em;
  margin: 2px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bh-remove { grid-column: 3; grid-row: 1; }
@media (min-width: 560px) {
  .bh-set { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 5.5em 44px; }
  .tool .bh-entry-out { grid-column: 3; grid-row: 1; align-self: center; margin: 18px 0 0; text-align: right; }
  .bh-remove { grid-column: 4; }
}
.bh-add-row { margin: 0 0 18px; }

.rate-field { display: grid; gap: 8px; }
.rate-field > label { color: var(--ink); font-size: 15px; font-weight: 700; }
.rate-inputs {
  display: grid;
  grid-template-columns: minmax(0, 6.5em) minmax(0, 1fr);
  gap: 8px;
}

.result-card {
  min-width: 0;
  padding: 18px 20px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
}
.tool .result-card p { margin: 0; }
.tool .result-k { color: var(--ink-3); font-size: 15px; }
.tool .result-v {
  margin: 2px 0 14px;
  color: var(--ink);
  font-size: clamp(30px, 9vw, 38px);
  font-weight: 800;
  font-stretch: 108%;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.tool .result-v.is-money { color: var(--green); }
.tool .result-detail {
  padding-top: 12px;
  border-top: 1px dashed var(--dash);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}

/* Billable hours in a year */
.year-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}
@media (min-width: 760px) { .year-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.year-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.year-field > label { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; }
.tool .year-field .hint { margin: -2px 0 0; font-size: 13px; line-height: 1.35; }
.tool .year-field .input { height: 48px; font-variant-numeric: tabular-nums; }
.input-unit { position: relative; }
.tool .input-unit .input { padding-right: 34px; }
.input-unit > span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--ink-3);
  font-size: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}
.year-result {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1.5px solid var(--green);
  border-radius: 16px;
  background: var(--white);
}
.tool .year-result p { margin: 0; }
.tool .formula {
  color: var(--ink-2);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tool .formula-total {
  margin: 4px 0 12px;
  color: var(--green);
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  font-stretch: 108%;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.formula-total small {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  font-stretch: 100%;
}
.tool .year-facts {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 15px;
}
.tool .formula-line {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--ink);
  font-size: 16px;
}

/* Timesheet template cards and previews */
.template-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 12px 0 8px;
}
@media (min-width: 720px) { .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.template-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1.5px solid var(--control);
  border-radius: 16px;
  background: var(--white);
}
.tool .template-card h3 { margin: 4px 0 0; font-size: 19px; }
.tool .template-card h2 { margin: 4px 0 0; }
.tool .template-card p { margin: 0; font-size: 16px; line-height: 1.5; }
.tool .dl-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}
.tool .dl-list li { margin: 0; }
.tool a.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--green);
  border-radius: 12px;
  background: var(--white);
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.tool a.dl:hover { background: var(--tint); color: var(--green); }
.tool a.dl.is-primary { background: var(--green); color: var(--white); }
.tool a.dl.is-primary:hover { background: var(--green-dark); color: var(--white); }
.dl-ext { font-weight: 500; }

.sheet-preview {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  padding: 5% 5% 0;
  border-radius: 12px;
  background: var(--track);
}
.sheet-preview::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(rgba(231, 236, 229, 0), var(--track));
}
.pv-paper {
  height: 100%;
  padding: 4.5cqw 4.5cqw 0;
  border-radius: 1cqw 1cqw 0 0;
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(20, 38, 29, 0.07), 0 1.5cqw 4cqw rgba(20, 38, 29, 0.12);
  color: var(--ink);
  font-size: var(--pv-font, 2.3cqw);
  line-height: 1.25;
}
.pv-w-5 .pv-paper { --pv-font: 2.6cqw; }
.pv-w-6 .pv-paper { --pv-font: 2.5cqw; }
.pv-w-7 .pv-paper { --pv-font: 2.25cqw; }
.pv-w-11 .pv-paper { --pv-font: 1.85cqw; }
.pv-w-14 .pv-paper { --pv-font: 1.65cqw; }
.tool .pv-paper p { margin: 0; font-size: inherit; line-height: inherit; }
.tool .pv-title {
  margin-bottom: 1.3em;
  color: var(--green);
  font-size: 1.9em;
  font-weight: 800;
  font-stretch: 112%;
}
.tool .pv-fields {
  display: flex;
  gap: 2.5em;
  margin-bottom: 1.3em;
  color: var(--ink-3);
}
.pv-fields span {
  flex: 1;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--dash);
}
.pv-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.pv-table th,
.pv-table td {
  height: 2.5em;
  padding: 0 0.45em;
  overflow: hidden;
  border: 1px solid var(--rule);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-table th { background: var(--tint); font-weight: 700; }
.pv-table .k-time,
.pv-table .k-break,
.pv-table .k-billable,
.pv-table .k-day,
.pv-table .k-date { text-align: center; }
.pv-table .k-hours,
.pv-table .k-total { text-align: right; }
.pv-table .k-label { font-weight: 700; }
.pv-table .is-filled { color: var(--green); font-weight: 600; }
.pv-table th.k-time { width: 4.6em; }
.pv-table th.k-break { width: 4.6em; }
.pv-table th.k-hours { width: 4.4em; }
.pv-table th.k-billable { width: 5em; }
.pv-table th.k-day { width: 3.3em; }
.pv-table th.k-total { width: 4.4em; }
.pv-table th.k-label { width: 7em; }
.pv-table th.k-date { width: 5em; }
.pv-table th.k-more { width: 1.6em; }
.pv-w-6 .pv-table th.k-label { width: 3.5em; }
.pv-w-6 .pv-table td.k-label { text-align: center; }
.pv-table .k-more { border-left-style: dashed; border-right-style: dashed; }

/* Invoice maker */
.maker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (min-width: 1000px) {
  .maker { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; }
  .maker-preview { position: sticky; top: 16px; }
}
.maker-form { min-width: 0; }
.mk-group {
  min-width: 0;
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1.5px solid var(--control);
  border-radius: 16px;
  background: var(--white);
}
.mk-group legend {
  margin-left: -6px;
  padding: 0 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}
.mk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 560px) { .mk-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mk-field > span,
.mk-field > label { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.3; }
.tool .mk-field .input { height: 48px; }
.tool .mk-field .textarea {
  height: auto;
  min-height: 86px;
  padding: 10px 14px;
  line-height: 1.45;
  resize: vertical;
}
.tool .inv-items {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.tool .inv-item {
  margin: 0;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.tool .inv-item:first-child { padding-top: 0; }
.inv-set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  grid-template-areas:
    "desc desc desc"
    "qty rate remove"
    "amount amount amount";
  gap: 8px;
  align-items: end;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.inv-desc { grid-area: desc; }
.inv-qty { grid-area: qty; }
.inv-rate { grid-area: rate; }
.inv-remove { grid-area: remove; }
.tool .inv-item-amount {
  grid-area: amount;
  min-height: 1.3em;
  margin: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tool .maker .hint { margin: 0; }
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 14px;
}
.tool .preview-bar .button { margin: 0; }
.tool .preview-bar .fine { flex: 1 1 16em; }

.invoice-paper {
  padding: 22px 18px 26px;
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--rule), 0 24px 48px -32px rgba(20, 38, 29, 0.45);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
@media (min-width: 560px) { .invoice-paper { padding: 36px 34px 40px; font-size: 14.5px; } }
.tool .invoice-paper p { margin: 0; font-size: inherit; line-height: inherit; }
.inv-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 26px;
}
.tool .inv-title {
  color: var(--green);
  font-size: 32px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1;
}
.inv-from { min-width: 0; }
@media (min-width: 560px) { .inv-from { text-align: right; } }
.tool .inv-name { font-weight: 700; }
.inv-lines { white-space: pre-line; }
.tool .inv-k {
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 650;
}
.inv-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
@media (min-width: 560px) { .inv-meta { grid-template-columns: minmax(0, 1fr) auto; } }
.inv-to { min-width: 0; }
.inv-dates {
  display: grid;
  gap: 4px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.inv-dates div,
.inv-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.inv-dates dt,
.inv-totals dt { color: var(--ink-3); }
.inv-dates dd,
.inv-totals dd { margin: 0; font-weight: 600; text-align: right; }
.inv-table {
  width: 100%;
  margin-bottom: 14px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.inv-table th {
  padding: 8px 6px;
  border-bottom: 1.5px solid var(--ink);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 650;
  text-align: left;
}
.inv-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--rule-soft);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.inv-table th:first-child,
.inv-table td:first-child { padding-left: 0; }
.inv-table th:last-child,
.inv-table td:last-child { padding-right: 0; }
.inv-table .num { text-align: right; white-space: nowrap; }
.inv-totals {
  display: grid;
  gap: 6px;
  max-width: 300px;
  margin: 0 0 24px auto;
  font-variant-numeric: tabular-nums;
}
.inv-totals .inv-due {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1.5px solid var(--ink);
  font-size: 17px;
}
.inv-totals .inv-due dt,
.inv-totals .inv-due dd { color: var(--ink); font-weight: 800; }
.inv-notes { display: grid; gap: 14px; }
.invoice-paper .is-sample { color: #66766D; font-style: italic; }

/* Payment reminder emails */
.tool .email-index {
  margin: 0 0 8px;
  padding-left: 24px;
  columns: 2 9em;
  column-gap: 32px;
  line-height: 1.3;
}
.tool .email-index li { margin: 0; break-inside: avoid; }
.tool .email-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.fill-form {
  margin: 8px 0 24px;
  padding: 0 16px;
  border: 1.5px solid var(--control);
  border-radius: 16px;
  background: var(--white);
}
.fill-form[open] { padding-bottom: 16px; }
.tool .fill-form .fill-title {
  display: flex;
  align-items: center;
  min-height: 52px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.fill-title::-webkit-details-marker { display: none; }
.fill-title::after {
  content: '+';
  margin-left: auto;
  padding-left: 12px;
  color: var(--green);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.fill-form[open] .fill-title::after { content: '\2212'; }
.tool .fill-form .hint { margin: 0 0 14px; }
.fill-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 14px;
}
@media (min-width: 560px) { .fill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .fill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.email-card {
  min-width: 0;
  margin: 0 0 18px;
  padding: 16px;
  border: 1.5px solid var(--control);
  border-radius: 16px;
  background: var(--white);
  scroll-margin-top: 16px;
}
.tool .email-card h3 { margin: 0 0 4px; }
.tool .email-when { margin: 0 0 12px; color: var(--ink-3); font-size: 15px; line-height: 1.5; }
.email {
  padding: 14px 16px;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}
.tool .email p { margin: 0 0 10px; }
.tool .email p:last-child { margin: 0; }
.tool .email .email-subject {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-weight: 700;
}
.email-subject-k { margin-right: 6px; color: var(--ink-3); font-weight: 600; }
.ph {
  padding: 0 3px;
  border-radius: 4px;
  background: #E2ECE5;
  color: var(--green-dark);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.ph.is-filled { padding: 0; background: transparent; color: inherit; font-weight: inherit; }
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 12px;
}
.tool .copy-row .button { min-height: 44px; margin: 0; padding: 0 18px; font-size: 15px; }
.copy-status { color: var(--green); font-size: 14px; font-weight: 600; }
.tool .advice li { margin: 8px 0; }

/* The one quiet path to Hourhaven on each page */
.tool-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin: 36px 0 8px;
  padding: 20px;
  border: 1.5px solid var(--green);
  border-radius: 16px;
  background: var(--white);
}
.tool-cta-text {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tool-cta-text img { flex: none; width: 40px; height: 40px; }
.tool .tool-cta p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.tool .tool-cta .button { margin: 0; }
@media (min-width: 720px) {
  .tool-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  .tool .tool-cta .button { flex: none; }
}

/* Printable timesheets (public/downloads/*.html) */
.sheet-body { background: var(--track); }
.sheet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px 12px;
}
.sheet-bar .button { margin: 0; }
.sheet-bar .fine { flex: 1 1 100%; }
.sheet {
  max-width: 1120px;
  margin: 0 auto 32px;
  padding: 22px 16px 26px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--rule);
  color: var(--ink);
}
@media (min-width: 720px) { .sheet { padding: 36px 40px; border-radius: 4px; } }
.sheet-title {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 26px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.sheet-fields,
.sheet-sign {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 0 0 18px;
}
.sheet-sign { margin: 22px 0 0; }
.sheet-fields p,
.sheet-sign p {
  display: flex;
  flex: 1 1 240px;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}
.sheet-line {
  flex: 1;
  min-width: 80px;
  height: 24px;
  border-bottom: 1px solid var(--ink-3);
}
.sheet-scroll { overflow-x: auto; }
.sheet-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.t-weekly-projects .sheet-table { min-width: 860px; }
.t-monthly-projects .sheet-table { min-width: 1080px; }
.sheet-table th,
.sheet-table td {
  height: 32px;
  padding: 2px 6px;
  overflow: hidden;
  border: 1px solid var(--dash);
  text-align: left;
}
.sheet-table thead th {
  height: 36px;
  background: var(--tint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sheet-table tbody th { font-weight: 700; }
.sheet-table tfoot th {
  padding-right: 10px;
  border: 0;
  font-weight: 700;
  text-align: right;
}
.sheet-table .sheet-sub th { color: var(--ink-3); font-weight: 600; }
.sheet-table .sheet-total .is-sum { border-top: 2px solid var(--ink); }
.sheet-table .is-blank { border: 0; }
.sheet-table .k-time { width: 11%; }
.sheet-table .k-break { width: 12%; }
.sheet-table .k-hours { width: 10%; }
.sheet-table .k-billable { width: 9%; }
.sheet-table .k-label { width: 15%; }
.sheet-table .k-date { width: 12%; }
.sheet-table .k-day { width: 8%; text-align: center; }
.sheet-table .k-total { width: 9%; }
.t-monthly .sheet-table .k-label { width: 8%; text-align: center; }
.t-monthly-projects .sheet-table .k-day { width: 2.3%; padding: 2px 1px; font-size: 11px; }
.t-monthly-projects .sheet-table .k-billable { width: 6%; }
.t-monthly-projects .sheet-table .k-total { width: 5%; }
.sheet-credit {
  margin: 18px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

/* Print: each page prints only what it is for. */
@page { margin: 12mm; }
@page invoice { margin: 0; }
@page sheet { margin: 0; }
@page sheet-wide { size: landscape; margin: 0; }

@media print {
  .tool-body,
  .sheet-body { background: #fff; }
  .tool-body .skip-link,
  .tool-body .site-header,
  .tool-body .site-footer,
  .tool-body .tool-cta,
  .tool-body .copy-row,
  .tool-body .fill-form { display: none !important; }
  .tool-body .wrap { max-width: none; padding: 0; }
  .tool-body .tool { padding: 0; }

  /* The chart page prints the two charts, on one sheet. */
  .page-chart .tool > :not(#chart) { display: none !important; }
  .page-chart .print-only { display: block; }
  .page-chart .print-row { display: none; }
  .page-chart .print-title {
    margin: 0 0 6mm;
    color: var(--green);
    font-size: 22pt;
    font-weight: 800;
  }
  .page-chart .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10mm; }
  .page-chart .table-scroll { overflow: visible; border-color: var(--dash); }
  .page-chart .chart th,
  .page-chart .chart td { padding: 2.2mm 4mm; }
  .page-chart .chart tbody td { font-size: 15pt; }
  .page-chart .chart tbody tr:nth-child(even) { background: none; }
  .page-chart .print-source { margin: 8mm 0 0; color: var(--ink-3); font-size: 9pt; }

  /* The invoice page prints the invoice alone, without the grey examples. */
  .page-invoice .tool > :not(#maker),
  .page-invoice #maker > :not(.maker),
  .page-invoice .maker-form,
  .page-invoice .preview-bar { display: none !important; }
  .page-invoice .maker { display: block; }
  .page-invoice .invoice-paper {
    page: invoice;
    padding: 16mm;
    border-radius: 0;
    box-shadow: none;
    font-size: 10.5pt;
  }
  .page-invoice .invoice-paper .is-sample { visibility: hidden; }
  .page-invoice .invoice-paper [data-show].is-sample,
  .page-invoice .invoice-paper tr.is-sample { display: none; }

  /* Printable timesheets: the sheet alone, sized to one page. */
  .sheet-bar { display: none; }
  .sheet {
    max-width: none;
    margin: 0;
    padding: 10mm 12mm;
    border-radius: 0;
    box-shadow: none;
    page: sheet;
  }
  .sheet.is-landscape { page: sheet-wide; }
  .sheet-title { margin-bottom: 3mm; font-size: 18pt; }
  .sheet-fields { margin-bottom: 4mm; }
  .sheet-sign { margin-top: 6mm; }
  .sheet-scroll { overflow: visible; }
  .sheet .sheet-table { min-width: 0; font-size: 9.5pt; }
  .sheet-table th,
  .sheet-table td { height: 8mm; }
  .sheet-table thead th { height: 9mm; }
  .t-monthly .sheet-table tbody th,
  .t-monthly .sheet-table tbody td { height: 5.9mm; }
  .sheet-credit { margin-top: 4mm; font-size: 8pt; }
}
