:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #141b22;
  background: #f6f6f5;
  font-size: 16px;
  line-height: 1.5;
  --accent: #a94508;
  --line: #e2e4e5;
  --muted: #59616a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #141b22;
  color: white;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
header a {
  color: white;
  font-weight: 650;
  text-decoration: none;
}
header span {
  font-size: 14px;
}
main {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 20px;
}
h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
}
h3 {
  font-size: 17px;
}
p {
  max-width: 70ch;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
.button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: 46px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover {
  background: #873606;
}
.secondary {
  background: white;
  color: #141b22;
  border-color: #bac9cf;
}
.secondary:hover {
  background: #f0f4f5;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
section,
details.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}
label {
  display: block;
  font-weight: 550;
  margin: 16px 0 6px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid #bac9cf;
  border-radius: 6px;
  padding: 11px 12px;
  background: white;
  margin-top: 6px;
  min-height: 46px;
}
input[type="checkbox"] {
  display: inline-block;
  width: 22px;
  min-height: 22px;
  margin-right: 10px;
  vertical-align: middle;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.wide {
  grid-column: 1/-1;
}
small,
.muted {
  color: var(--muted);
  font-size: 14px;
}
.notice {
  padding: 14px 18px;
  border: 1px solid #bac9cf;
  background: white;
  border-radius: 6px;
  margin: 16px 0;
}
.error {
  color: #a53336;
  border-color: #a53336;
}
canvas {
  display: block;
  width: 100%;
  height: 180px;
  border: 1px solid #849fa9;
  border-radius: 6px;
  touch-action: none;
  background: white;
}
.signature img {
  max-width: 100%;
  height: 120px;
  object-fit: contain;
}
.photos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.photos figure {
  margin: 12px 0;
  max-width: 180px;
}
.photos img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}
.photos figcaption {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.photos button {
  font-size: 12px;
  margin-top: 8px;
  min-height: 44px;
}
.entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child {
  border-bottom: 0;
}
.entry p {
  margin: 4px 0;
}
.entry .actions {
  margin: 12px 0 0;
}
.status {
  font-weight: 600;
  color: var(--accent);
}
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  font-weight: 600;
}
footer {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 20px;
  color: var(--muted);
  font-size: 12px;
}
:focus-visible {
  outline: 3px solid #a94508;
  outline-offset: 3px;
}
::selection {
  background: #fff0e5;
}
input,
textarea {
  caret-color: var(--accent);
}
@media (max-width: 580px) {
  main {
    margin: 24px auto;
    padding: 0 16px;
  }
  header {
    padding: 16px;
  }
  section,
  details.panel {
    padding: 18px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .actions > * {
    flex: 1 1 auto;
  }
  h1 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
select {
  appearance: none;
  height: 48px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23607480' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input::placeholder,
textarea::placeholder {
  color: #59616a;
  opacity: 1;
}

header .mobile-brand { background: white; border-radius: 6px; padding: 8px 12px; }
.mobile-brand img { display:block; width:150px; height:auto; }
