* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 system-ui,
    sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
nav {
  display: flex;
  gap: 24px;
}
a {
  color: var(--accent);
  font-weight: 650;
  min-height: 44px;
  align-content: center;
}
main {
  max-width: 850px;
  margin: 32px auto;
  padding: 0 20px 60px;
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  color: var(--heading);
}
h2 {
  font-size: 24px;
  line-height: 1.25;
  color: var(--heading);
}
p {
  max-width: 70ch;
}
label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 600;
}
input,
textarea,
select,
button {
  font: inherit;
  min-height: 44px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
button {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}
button.primary {
  background: var(--accent);
  color: var(--button-ink);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:active {
  transform: scale(0.98);
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.entry,
.saved {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
}
.check input {
  width: 24px;
  min-height: 24px;
}
.muted {
  color: var(--muted);
}
.totals {
  margin-top: 24px;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.totals p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.total {
  font-size: 24px;
  font-weight: 700;
}
.document {
  background: var(--paper);
  padding: 24px;
  border-radius: 8px;
}
.document img {
  display: block;
  width: min(100%, 360px);
  height: auto;
}
.document h2 {
  font-size: 22px;
}
.document p,
.scope {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.error {
  font-weight: 650;
  color: var(--ink);
}
@media (hover: hover) {
  button:hover {
    border-color: var(--accent);
  }
  button.primary:hover {
    background: var(--accent-hover);
  }
}
@media (max-width: 540px) {
  header {
    padding: 12px 16px;
    gap: 12px;
  }
  nav {
    gap: 16px;
  }
  main {
    margin-top: 24px;
  }
  .document {
    padding: 16px;
  }
  .pair {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media print {
  header,
  .actions,
  #feedback,
  .owner-note {
    display: none;
  }
  body {
    background: #fff;
    color: #172c35;
  }
  main {
    margin: 0;
    max-width: none;
    padding: 0;
  }
  .document {
    padding: 0;
  }
  .entry {
    break-inside: avoid;
  }
}
/* Conversational invoice entry reuses the existing light/dark theme. */
#invoice-conversation {
  margin: 28px 0;
}
.invoice-message {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.invoice-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.from-owner {
  padding-left: 20px;
}
#invoice-note {
  min-height: 132px;
  resize: vertical;
}
.photo-button {
  display: inline-block;
  margin: 0;
  cursor: pointer;
}
.photo-button input {
  max-width: 250px;
  padding: 8px 0;
  border: 0;
  background: transparent;
}
.outcome-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.outcome-photos img {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 6px;
}
.invoice-draft,
.private-invoice-pricing {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.private-invoice-pricing dl {
  margin: 20px 0;
}
.private-invoice-pricing dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.private-invoice-pricing dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
#invoice-destination {
  margin-top: 24px;
}
@media print {
  #invoice-conversation,
  #invoice-chat-form,
  #invoice-proposal,
  #invoice-destination {
    display: none;
  }
}
