/* app.css · the invoice page. the wire layer is wireframe.css; this file only lays it out.
   the one colour is the red of the paid stamp and the strike, his call (DECISIONS IV-01). */

:root { --red: #8a0303; }

body { margin: 0; background: var(--paper); }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap {
  flex-grow: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 40px 16px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 56px; align-items: flex-start; align-content: flex-start;
}

/* --- the controls --------------------------------------------------------- */
.controls { flex: 0 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.edit { display: flex; flex-direction: column; gap: 32px; }
.edit[hidden] { display: none; }
.nav { display: flex; align-items: center; gap: 8px; }
.month { flex-grow: 1; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.group { display: flex; flex-direction: column; gap: 8px; }
.lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-light); }
label.lab { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.wf-chip { display: inline-flex; align-items: center; gap: 6px; }
.pair { display: inline-flex; }
.pair .x { border-left: 0; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1 1 0; min-width: 0; }
.row2.fixed > button { flex: 0 0 auto; }
.mk { font-size: 11px; }
.strike { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 1.5px; }

/* --- the invoice ---------------------------------------------------------- */
.inv { flex: 0 1 460px; min-width: 0; }
.sheet {
  container-type: inline-size; position: relative; overflow: hidden;
  padding: 40px 32px; display: flex; flex-direction: column; gap: 40px;
  border: 1px solid var(--ink); outline: 1px dashed var(--ink-light); outline-offset: 6px;
}
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: last baseline; gap: 16px; }
.head h1 { margin: 0; font-size: 16cqw; font-weight: 600; letter-spacing: -0.03em; line-height: 0.9; }
.head dl {
  margin: 0; display: grid; grid-template-columns: auto auto; column-gap: 16px;
  row-gap: max(0px, calc(5.84cqw - 19px)); font-size: 13px; line-height: 1.1;
}
.head dt { color: var(--ink-light); }
.head dd { margin: 0; text-align: right; }

.parties { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.party { display: flex; flex-direction: column; gap: 6px; }
.party span:first-child { font-size: 12px; color: var(--ink-light); }
.party span:last-child { font-size: 15px; font-weight: 600; }
.stampslot { position: relative; width: 0; align-self: stretch; }
.stamp {
  position: absolute; right: 0; top: 50%; white-space: nowrap; pointer-events: none;
  transform: translateY(-50%) rotate(-8deg); border: 3px solid var(--red); padding: 2px 14px;
  font-size: 30px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.3; color: var(--red);
}

.lines { display: flex; flex-direction: column; }
.th, .tr { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; }
.th { padding: 0 0 8px; border-bottom: 1px solid var(--ink); font-size: 12px; color: var(--ink-light); }
.tr { align-items: baseline; min-height: 44px; padding: 12px 0; border-bottom: 1px dotted var(--ink-light); font-size: 14px; }
.r { text-align: right; white-space: nowrap; }
.item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.item .mk { color: var(--ink-light); }
.item a { font-size: 12px; text-underline-offset: 2px; }
.was { margin-right: 12px; }

.sum { margin-top: auto; margin-left: 104px; display: flex; flex-direction: column; font-size: 13px; }
.sl { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 6px 0; }
.sl > span:not(:last-child) { color: var(--ink-light); }
.tot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--ink);
}
.tot .lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.tot .big { font-size: min(36px, 8.5cqw); font-weight: 600; letter-spacing: -0.02em; }

/* --- the foot ------------------------------------------------------------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.foot .wf-act { font-size: 11px; }
.grow { flex-grow: 1; }
.credits {
  flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px;
  padding: 8px 0 4px; border-top: 1px dotted var(--ink-light);
}
.credits[hidden] { display: none; }

/* --- the phone ------------------------------------------------------------ */
@media (max-width: 820px) { .inv { order: -1; } }
@media (max-width: 480px) { .sheet { padding: 40px 24px; } }
