:root {
  color-scheme: light;
  --ink: #0b0b0c;
  --muted: #4a4d52;
  --line: #dcdcd8;
  --surface: #f3f3f1;
  --accent: #b8430f;
  --tint: #fff3eb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); font: 15px/1.5 system-ui, sans-serif; }
h2, p { margin: 0; }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 1.2; letter-spacing: -.035em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { min-width: 0; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line); border-radius: 14px; background: white; }
.project { background: var(--surface); }
.heading, .project-heading, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heading, .project-heading { justify-content: space-between; }
.heading { margin-bottom: 24px; }
fieldset { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
legend, label, summary { font-weight: 650; }
legend { padding: 0; margin-bottom: 8px; }
label { display: block; min-width: 0; font-size: .875rem; }
.fields, .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
form > .fields { grid-template-columns: minmax(0, 1fr) minmax(70px, 100px); margin-top: 18px; }
.choices label { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.choices label:has(:checked) { color: #8f300d; border-color: var(--accent); background: var(--tint); }
input[type="radio"] { margin: 0; accent-color: var(--accent); }
button, input, select, textarea { font: inherit; }
input:not([type="radio"]), select, textarea { width: 100%; display: block; margin-top: 5px; padding: 9px 10px; border: 1px solid #bcbcb7; border-radius: 7px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hint, .measure-tip p { margin: 8px 0; color: var(--muted); font-size: .875rem; }
.measure-tip { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; background: var(--surface); }
.measure-tip svg { width: 85px; flex: 0 0 auto; }
.estimate { margin-top: 14px; padding: 10px 12px; background: var(--tint); border-left: 3px solid var(--accent); font-weight: 650; }
.extras { margin-top: 18px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { cursor: pointer; }
.extras > label, .extras .fields { margin-top: 12px; }
.form-actions, .export { margin-top: 16px; }
.button, .secondary { padding: 8px 12px; min-height: 40px; border-radius: 7px; font-weight: 700; cursor: pointer; }
.button { color: white; background: var(--accent); border: 1px solid var(--accent); }
.button:hover { background: #92340c; }
.secondary { color: var(--ink); background: white; border: 1px solid #c3c3bf; }
.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .56; cursor: default; }
.error { color: #a22318; margin-top: 10px; }
.pill { padding: 3px 9px; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; white-space: nowrap; }
.empty { margin-top: 16px; padding: 18px 12px; background: white; border: 1px dashed #b9b9b5; border-radius: 8px; text-align: center; color: var(--muted); }
.entry { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; overflow-wrap: anywhere; break-inside: avoid; }
.entry p { font-size: .875rem; margin-top: 4px; }
.entry .measure { font-size: 1.15rem; font-weight: 750; }
.entry .actions { margin-top: 8px; }
.entry img, #photo-preview img { display: block; max-width: 100%; max-height: 150px; margin: 8px 0; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 690px) {
  .workspace { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 360px) {
  .choices { grid-template-columns: 1fr; }
}
@media print {
  .workspace { display: block; }
  .project, .entry { background: white; }
  .project { border: 0; padding: 0; }
  form, .export, .no-print, .entry .actions { display: none !important; }
}
