:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f7f1e7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f7f1e7;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin-top: 0;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #b7c1d1;
  border-radius: 8px;
  padding: 0.68rem 0.75rem;
  color: #172033;
  background: #ffffff;
}

@media screen {
  select:not([multiple]) {
    appearance: none;
    padding-right: 2.5rem;
    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='%23172033' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 0.75rem 0.5rem;
  }
}

@media (forced-colors: active) {
  select:not([multiple]) {
    appearance: auto;
    padding-right: 0.75rem;
    background-image: none;
  }
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(34, 93, 171, 0.2);
  outline-offset: 2px;
  border-color: #225dab;
}

.app-footer .app-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0.15rem 0.8rem;
  position: relative;
}

.footer-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.footer-developer-line::before {
  content: "|";
  margin: 0 0.35rem;
  color: #526078;
}

/* Hidden until the legal pages are ready. */
.app-footer .footer-links {
  display: none;
}

/* Compact values in the automatic invoice-numbering summary. */
body .numbering-summary dt,
body .invoice-number-label {
  font-size: 0.72rem;
  line-height: 1.25;
}

body .numbering-summary dd,
body .invoice-number-card input {
  font-size: 1.05rem;
  line-height: 1.25;
}

body #invoice-number-status {
  font-size: 0.95rem;
  line-height: 1.25;
}

/* Keep the clear-fields action neutral, but visibly identifiable as a button. */
body #clear-form.button.button-secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #172033;
  box-shadow: none;
}

body #clear-form.button.button-secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

body #clear-form.button.button-secondary:focus-visible {
  border-color: #225dab;
  outline: 3px solid rgba(34, 93, 171, 0.2);
  outline-offset: 2px;
}

body #clear-form.button.button-secondary:disabled {
  border-color: #d7deea;
  background: #f8fafc;
  color: #7b879a;
  cursor: not-allowed;
}

/* On mobile, keep the footer in the normal document flow. */
@media (max-width: 680px) {
  html body {
    --app-footer-reserve: 0rem;
  }

  body .app-footer {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    box-shadow: none;
  }
}
