:root {
  color-scheme: light;
  --paper: #f2f6f5;
  --surface: #fff;
  --ink: #203734;
  --forest: #0c6b58;
  --muted: #5b726b;
  --line: #d4dfda;
  --danger: #ac3636;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
html { scroll-padding-block: 24px 170px; }
input, select, textarea { scroll-margin-block: 24px 170px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, label, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #369e87; outline-offset: 3px; }
h1, h2, h3, .brand strong { font-family: Bahnschrift, "Segoe UI", sans-serif; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.45rem; line-height: 1.25; }
h2 { font-size: 1.85rem; line-height: 1.2; margin-bottom: 0; }
h3 { font-size: 1.1rem; margin: 0 0 20px; }
.site-header { min-height: 84px; padding: 18px max(28px, calc((100vw - 1360px) / 2)); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 10px; background: var(--forest); color: white; flex: 0 0 auto; }
.brand-mark svg { width: 30px; height: 30px; }
.brand strong { display: block; font-size: 1.12rem; line-height: 1.35; }
.brand span:not(.brand-mark) { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.account { display: flex; align-items: center; gap: 16px; font-size: .85rem; color: var(--muted); }
.account span { max-width: 220px; overflow-wrap: anywhere; }
.stand-notice { padding: 11px 24px; background: #e9efeb; border-bottom: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 9px; color: #456057; font-size: .8rem; line-height: 1.5; }
.notice-dot { width: 6px; height: 6px; border-radius: 50%; background: #9a702a; flex: 0 0 auto; }
.button { min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: .9rem; line-height: 1.4; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; text-align: center; }
.primary { background: var(--forest); color: white; }
.primary:hover:not(:disabled) { background: #075442; }
.secondary { background: white; border-color: #b9cdc3; color: var(--forest); }
.secondary:hover:not(:disabled) { background: #edf5f0; }
.quiet { background: transparent; color: var(--forest); padding-inline: 10px; }
.quiet:hover:not(:disabled) { background: #e5efe9; }
.compact { padding: 8px 10px; font-size: .8rem; }
.full { width: 100%; }
.inline-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.login-layout { display: flex; justify-content: center; padding: 7vh 24px 50px; }
.login-sheet { max-width: 500px; width: 100%; background: var(--surface); padding: 42px 44px; border-radius: 12px; border: 1px solid var(--line); }
.login-symbol { width: 58px; height: 58px; display: grid; place-items: center; border: 2px solid var(--forest); color: var(--forest); border-radius: 50%; font-family: Bahnschrift, sans-serif; margin-bottom: 28px; font-size: 1.25rem; }
.login-sheet h1 { font-size: 2.15rem; line-height: 1.2; margin-bottom: 18px; }
.intro { color: var(--muted); line-height: 1.65; margin-bottom: 32px; }
.login-sheet .button { margin-top: 12px; }
label, legend { display: block; font-size: .9rem; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #b5c7be; border-radius: 6px; padding: 11px 12px; background: white; color: var(--ink); font-size: 1rem; line-height: 1.4; }
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #7a8e84; }
input:disabled, select:disabled, textarea:disabled { opacity: 1; color: var(--ink); background: #f7f9f8; -webkit-text-fill-color: var(--ink); }
.field-help { color: var(--muted); font-size: .79rem; line-height: 1.6; margin: 7px 0 0; }
.workspace { max-width: 1360px; margin: 32px auto 60px; padding: 0 28px; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 30px; align-items: start; }
.visits-panel { position: sticky; top: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 15px; }
.panel-heading h1 { margin: 0; font-size: 1.3rem; }
.visits-list { display: grid; gap: 8px; margin: 20px 0; }
.visit-item { width: 100%; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 17px 16px; color: var(--ink); }
.visit-item:hover { background: #e8efeb; }
.visit-item.selected { background: white; border-color: #97c0af; box-shadow: inset 3px 0 var(--forest); }
.visit-date { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.visit-item strong { display: block; font-size: 1rem; margin-bottom: 7px; }
.visit-reference { display: block; color: var(--muted); font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; border-radius: 5px; font-size: .73rem; font-weight: 600; padding: 5px 8px; background: #e9eeeb; color: #466458; line-height: 1.3; }
.badge.draft { background: #e4eee7; color: #256d4c; }
.badge.submitted { background: #f5ecd9; color: #815f1e; }
.badge.cancelled { background: #eceeec; color: #67756e; }
.report-panel { min-width: 0; }
.empty-view { text-align: center; padding: 120px 20px; }
.empty-symbol { width: 80px; height: 80px; color: #769a89; margin-bottom: 20px; }
.empty-view h2 { font-size: 1.5rem; margin-bottom: 12px; }
.empty-view p { color: var(--muted); line-height: 1.65; }
.report-sheet { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.report-heading { padding: 30px 36px 25px; border-bottom: 1px solid var(--line); }
.report-title-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.context-label { color: var(--forest); font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.visit-context { color: var(--muted); font-size: .86rem; line-height: 1.6; margin: 14px 0 0; overflow-wrap: anywhere; }
.report-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-section { margin: 0 36px; padding: 28px 0; border-bottom: 1px solid #e3eae5; }
.form-section:last-child { border-bottom: 0; }
.choice-field { padding: 0; margin: 0 0 20px; border: 0; min-width: 0; }
.choices { display: flex; gap: 10px; }
.choices label { position: relative; margin: 0; flex: 1 1 0; max-width: 230px; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span { display: block; text-align: center; padding: 12px 10px; min-height: 46px; border: 1px solid #b5c7be; border-radius: 6px; cursor: pointer; font-weight: 500; }
.choices input:checked + span { border-color: var(--forest); color: var(--forest); background: #eaf4ed; box-shadow: inset 0 0 0 1px var(--forest); font-weight: 600; }
.choices input:focus-visible + span { outline: 3px solid #369e87; outline-offset: 3px; }
.choices input:disabled + span { cursor: default; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.date-field { margin-top: 24px; max-width: 310px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-heading h3 { margin: 0; }
.section-heading .field-help { margin: 0; }
.drop-zone { border: 1px dashed #9fbbaa; padding: 20px; border-radius: 7px; background: #f8fbf9; margin-top: 14px; line-height: 1.7; }
.drop-zone > span { color: var(--muted); font-size: .85rem; margin-left: 10px; }
.drop-zone label { margin: 0; cursor: pointer; }
.drop-zone.drag-over { border-color: var(--forest); background: #e9f4ec; }
.drop-zone:focus-within { outline: 3px solid #369e87; outline-offset: 3px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e3eae5; padding: 13px 0; }
.file-row:last-child { border-bottom: 0; }
.file-info { flex: 1; min-width: 0; }
.file-info strong { font-size: .86rem; line-height: 1.5; display: block; overflow-wrap: anywhere; }
.file-info .field-help { margin-top: 2px; }
.file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; flex-shrink: 0; }
.file-actions .button { font-size: .77rem; min-height: 42px; padding: 8px; }
.pending-files { margin-top: 10px; }
.file-error, .field-help.error { color: var(--danger); }
.editor-actions { position: sticky; bottom: 0; padding: 18px 24px; background: #fbfdfb; border-top: 1px solid var(--line); display: flex; gap: 15px; justify-content: space-between; align-items: center; z-index: 1; }
.editor-actions strong { font-size: .8rem; font-weight: 600; }
.editor-actions .field-help { max-width: 275px; font-size: .74rem; margin: 3px 0 0; }
.editor-actions .inline-actions { flex-shrink: 0; }
.message { margin: 20px 36px 0; padding: 16px 18px; border-radius: 6px; background: #edf3f0; color: #355d4b; font-size: .86rem; line-height: 1.6; overflow-wrap: anywhere; }
.message p { margin: 5px 0 10px; }
.message.error { color: #8b2929; background: #fff0ef; border-left: 3px solid #bb5555; }
.message.warning { color: #70521f; background: #faf3e3; border-left: 3px solid #c8a35f; }
.message.success { color: #195c42; background: #eaf5ed; border-left: 3px solid #328365; }
.message .inline-actions { margin-top: 12px; }
.mobile-back { display: none; }
dialog { border: 1px solid var(--line); border-radius: 12px; width: min(620px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; color: var(--ink); }
dialog::backdrop { background: #132e286b; }
.dialog-body { padding: 28px 30px; }
.dialog-body .message { margin: 24px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: #f8fbf9; position: sticky; bottom: 0; }
.review-summary { margin: 24px 0 0; }
.review-summary dt { font-size: .8rem; color: var(--muted); margin-top: 18px; }
.review-summary dd { margin: 4px 0 0; font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1150px) {
  .workspace { grid-template-columns: 245px minmax(0, 1fr); gap: 20px; padding: 0 20px; }
  .report-heading { padding-inline: 26px; }
  .form-section { margin-inline: 26px; }
  .message { margin-inline: 26px; }
  .editor-actions { flex-direction: column; align-items: stretch; }
  .editor-actions .field-help { max-width: none; }
  .editor-actions .inline-actions { justify-content: flex-end; }
}
@media (max-width: 800px) {
  .site-header { padding: 14px 18px; min-height: 76px; }
  .brand strong { font-size: .95rem; }
  .brand-mark { width: 38px; height: 38px; border-radius: 8px; }
  .account { gap: 0; }
  .account span { display: none; }
  .stand-notice { justify-content: flex-start; padding: 10px 20px; font-size: .74rem; }
  .workspace { display: block; margin: 22px auto 35px; padding: 0 16px; }
  .visits-panel { position: static; }
  .report-panel { display: none; }
  .show-report .report-panel { display: block; }
  .show-report .visits-panel { display: none; }
  .mobile-back { display: inline-flex; margin: 8px 8px 0; }
  .report-heading { padding: 10px 20px 22px; }
  .report-title-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  h2 { font-size: 1.6rem; }
  .form-section { margin-inline: 20px; padding-block: 24px; }
  .message { margin-inline: 20px; }
  .editor-actions { padding: 15px 16px max(15px, env(safe-area-inset-bottom)); }
  .editor-actions .inline-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .editor-actions .button { padding-inline: 9px; font-size: .8rem; min-height: 48px; }
  .section-heading { flex-wrap: wrap; }
  .two-columns { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .location-section .two-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .drop-zone > span { display: none; }
  .file-row { flex-direction: column; gap: 4px; }
  .file-actions { align-self: flex-end; }
  .login-layout { padding: 30px 18px; }
  .login-sheet { padding: 28px 24px; }
  .login-sheet h1 { font-size: 1.9rem; }
  .dialog-body { padding: 25px 20px; }
  .dialog-actions { padding: 15px; flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
