/* Fieldmark Material Design 3 inspired visual system */
:root {
  color-scheme: light;
  --navy: #26334f;
  --navy-2: #384968;
  --ink: #1b1b1f;
  --muted: #5f6675;
  --line: #c5c8d1;
  --canvas: #f7f8fc;
  --white: #fff;
  --blue: #405f9f;
  --blue-dark: #304b86;
  --teal: #006b62;
  --green: #28664c;
  --green-soft: #d8f1df;
  --amber: #805600;
  --amber-soft: #ffedc2;
  --red: #ba1a1a;
  --red-soft: #ffdad6;
  --shadow: 0 2px 8px rgba(31, 41, 67, .09), 0 1px 3px rgba(31, 41, 67, .06);
  --radius: 16px;
  --font: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --display: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --md-primary: #405f9f;
  --md-on-primary: #ffffff;
  --md-primary-container: #dce2ff;
  --md-on-primary-container: #001943;
  --md-secondary-container: #e0e2ec;
  --md-surface-container: #eef0f7;
  --md-surface-container-low: #f2f3fa;
  --md-outline: #747783;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(64, 95, 159, .28);
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* App layout and navigation */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 264px; flex: 0 0 264px; min-height: 100vh; height: 100vh;
  position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column;
  padding: 24px 14px 16px; color: #252b3a; background: #f0f2f9;
  border-right: 1px solid #e4e6ef;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 3px 12px 34px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 14px; background: var(--md-primary); box-shadow: none;
}
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-word { color: #1b2438; font: 750 19px/1 var(--display); letter-spacing: -.45px; }
.brand-word span { display: block; color: #626b7d; margin-top: 5px; font: 700 9px/1.2 var(--font); letter-spacing: 1.65px; }
.workspace-label { padding: 0 14px 10px; color: #72798a; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; }
.side-nav { display: grid; gap: 4px; }
.nav-item {
  height: 48px; padding: 0 15px; display: flex; align-items: center; gap: 14px;
  border-radius: 999px; color: #464d5d; font-size: 14px; font-weight: 600;
  transition: background .18s, color .18s;
}
.nav-item:hover { color: #1b2438; background: #e5e8f1; transform: none; }
.nav-item.active { color: var(--md-on-primary-container); background: var(--md-primary-container); box-shadow: none; }
.nav-icon { width: 20px; text-align: center; color: #5b6272; font-size: 18px; }
.nav-item.active .nav-icon { color: var(--md-on-primary-container); }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 7px; text-align: center; border-radius: 999px; background: rgba(64,95,159,.12); color: #334d83; font-size: 11px; font-weight: 700; }
.sidebar-spacer { flex: 1; }
.sidebar-tip {
  margin: 20px 5px 18px; padding: 16px; border: 0; border-radius: 18px;
  color: #26334f; background: #e4e8f4;
}
.tip-icon { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: #cbd5f0; color: #334f91; }
.sidebar-tip strong { color: #283654; font-size: 13px; }
.sidebar-tip p { margin: 5px 0 0; color: #59657e; font-size: 12px; line-height: 1.5; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 15px 8px 2px; border-top: 1px solid #dfe2eb; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e9c9b7; color: #603b2e; font-size: 12px; font-weight: 750; }
.profile-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.profile-copy strong { color: #292d37; font-size: 12px; }
.profile-copy span { color: #717887; font-size: 11px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #535b6a; font-size: 17px; transition: background .18s; }
.icon-button:hover { background: #e7e9f0; color: #293b65; }
.icon-button.subtle { width: 34px; height: 34px; background: #e4e7ef; color: #4d586d; }
.install-button { min-height: 40px; padding: 8px 15px; font-size: 13px; }
.mobile-menu { display: none; }
.main-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: 68px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 15; background: rgba(247,248,252,.94);
  border-bottom: 1px solid #e7e8ef; backdrop-filter: blur(16px);
}
.breadcrumbs { display: flex; align-items: center; gap: 11px; color: #777d8a; font-size: 13px; }
.breadcrumbs b { color: #a7abb5; font-weight: 400; }
.breadcrumbs strong { color: #303848; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-status { display: flex; align-items: center; gap: 8px; margin-right: 7px; color: #5f6776; font-size: 12px; }
.connection-status i { width: 8px; height: 8px; border-radius: 50%; background: #31845a; box-shadow: 0 0 0 4px rgba(49,132,90,.10); }
.notification-button { position: relative; }
.notification-button i { position: absolute; right: 9px; top: 8px; width: 7px; height: 7px; border: 1px solid #f7f8fc; border-radius: 50%; background: #ba1a1a; }
.small-avatar { width: 34px; height: 34px; }

/* Page typography and action buttons */
.view { width: min(1320px, 100%); margin: 0 auto; padding: 36px 38px 48px; flex: 1; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #626b7c; font-size: 11px; font-weight: 700; letter-spacing: 1.05px; }
.page-heading h1 { margin: 0; color: #202638; font: 700 clamp(26px, 3vw, 34px)/1.2 var(--display); letter-spacing: -.75px; }
.wave { color: #ba8d2e; font-size: 21px; vertical-align: 4px; }
.heading-subtitle { margin: 8px 0 0; color: #666e7d; font-size: 14px; }
.heading-actions { display: flex; gap: 10px; }
.button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 1px solid transparent; border-radius: 999px;
  font-size: 14px; line-height: 1.2; font-weight: 650; letter-spacing: .05px;
  transition: box-shadow .18s, background .18s, transform .18s;
}
.button:hover { transform: none; }
.button-primary { background: var(--md-primary); color: #fff; box-shadow: none; }
.button-primary:hover { background: #334f8a; box-shadow: 0 2px 7px rgba(36,54,95,.20); }
.button-quiet, .button-outline { border-color: #777f8e; background: transparent; color: #40506c; }
.button-quiet:hover, .button-outline:hover { background: rgba(64,95,159,.07); }
.button-tonal { border: 0; color: #253c70; background: #dce2ff; }
.button-tonal:hover { background: #cbd5ff; }
.button-text { border: 0; color: #405f9f; background: transparent; }
.button-text:hover { background: rgba(64,95,159,.08); }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 36px; }
.metric-card {
  min-height: 124px; padding: 18px 20px; border: 1px solid transparent; border-radius: 18px;
  background: #eef0f7; box-shadow: none; transition: background .2s;
}
.metric-card:hover { background: #e8eaf3; transform: none; box-shadow: none; }
.metric-blue { border-color: #d2daf2; background: #e8edff; }
.metric-blue:hover { background: #dfe6ff; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #525b6c; font-size: 13px; font-weight: 550; }
.metric-glyph { color: #516999; font-size: 19px; }
.metric-value { margin: 8px 0 2px; color: #202c45; font: 700 30px/1.2 var(--display); letter-spacing: -.6px; }
.metric-note { color: #616b7d; font-size: 11px; }
.metric-note .dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.dot-blue { background: #405f9f; }
.inspection-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.inspection-toolbar h2 { margin: 0; color: #252b3a; font: 650 21px/1.25 var(--display); letter-spacing: -.3px; }
.inspection-toolbar p { margin: 5px 0 0; color: #626b7a; font-size: 13px; }
.toolbar-controls { display: flex; align-items: center; gap: 10px; }
.search-box { width: 240px; height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid #777f8e; border-radius: 8px; background: transparent; color: #646d7e; }
.search-box span { font-size: 20px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: #293244; font-size: 13px; }
.search-box input::placeholder { color: #747c89; }
.filter-select { min-width: 160px; height: 44px; padding: 0 13px; border: 1px solid #777f8e; border-radius: 8px; background: transparent; color: #414b60; font-size: 13px; }
.inspection-list { display: grid; gap: 12px; }
.inspection-card {
  display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 17px;
  padding: 18px 20px; border: 1px solid #e3e5ed; border-radius: 16px; background: #fff;
  box-shadow: 0 1px 3px rgba(30,39,61,.04); transition: border-color .2s, box-shadow .2s;
}
.inspection-card:hover { border-color: #c6cee3; box-shadow: var(--shadow); transform: none; }
.inspection-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #e3e8f8; color: #405f9f; font-size: 20px; }
.inspection-icon.tone-green { color: #28664c; background: #dcefe4; }
.inspection-icon.tone-orange { color: #815700; background: #ffedc7; }
.inspection-icon.tone-purple { color: #66508d; background: #eee4fa; }
.inspection-icon.tone-grey { color: #5e6370; background: #e9eaf0; }
.inspection-body { min-width: 0; }
.inspection-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inspection-title-row h3 { margin: 0; color: #252b3a; font-size: 15px; font-weight: 650; }
.inspection-description { margin: 5px 0 8px; color: #606978; font-size: 13px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 17px; color: #737b89; font-size: 11px; }
.inspection-right { display: flex; align-items: center; gap: 18px; }
.deadline-copy { min-width: 105px; text-align: right; }
.deadline-copy strong { display: block; color: #323a4d; font-size: 13px; font-weight: 650; }
.deadline-copy span { display: block; margin-top: 2px; color: #727b8a; font-size: 11px; }
.card-action { min-width: 116px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-available { color: #155d3a; background: #d9f2e2; }
.status-progress { color: #344d87; background: #e0e6ff; }
.status-upcoming { color: #795300; background: #ffedc5; }
.status-overdue { color: #9b2926; background: #ffdfdc; }
.status-completed { color: #4f5663; background: #e8e9ee; }
.footer-note { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: #707887; font-size: 12px; }
.footer-note span { color: #536c9d; font-size: 15px; }
.bottom-bar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; border-top: 1px solid #e6e8ef; background: #f3f4f9; color: #656d7c; font-size: 11px; }
.bottom-bar b { color: #9ba1ad; font-weight: 500; padding: 0 4px; }

/* Inspection splash and section flow */
.flow-view { padding-top: 25px; }
.flow-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.back-link { border: 0; padding: 8px 12px 8px 0; background: transparent; color: #405f9f; font-size: 13px; font-weight: 650; }
.back-link:hover { color: #273f79; }
.flow-context { display: flex; align-items: center; gap: 9px; color: #666f80; font-size: 11px; }
.flow-context span { color: #737b89; }
.flow-context b { color: #9ba1ad; font-weight: 400; }
.flow-context strong { color: #34405a; font-weight: 650; }
.start-splash {
  max-width: 960px; margin: 5px auto 30px; overflow: hidden; border: 1px solid #e2e5ee;
  border-radius: 24px; background: #fff; box-shadow: 0 2px 7px rgba(31,41,67,.06);
  animation: cardEnter .4s both;
}
.splash-banner { position: relative; overflow: hidden; padding: 30px 32px; color: #1d2a46; background: #e2e8fb; }
.splash-banner:before, .splash-banner:after { position: absolute; content: ""; width: 290px; height: 290px; right: -90px; top: -185px; border: 1px solid rgba(64,95,159,.13); border-radius: 50%; }
.splash-banner:after { width: 220px; height: 220px; right: 45px; top: -145px; }
.splash-kicker { position: relative; z-index: 1; color: #465b91; font-size: 11px; font-weight: 750; letter-spacing: 1.1px; }
.splash-banner h1 { position: relative; z-index: 1; margin: 9px 0; color: #202d4b; font: 700 28px/1.2 var(--display); letter-spacing: -.5px; }
.splash-banner p { position: relative; z-index: 1; max-width: 620px; margin: 0; color: #475675; font-size: 14px; }
.splash-content { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; padding: 28px 32px 32px; }
.splash-details h3, .start-form h3 { margin: 0 0 13px; color: #292f40; font: 650 17px var(--display); }
.splash-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.summary-tile { padding: 13px 14px; border: 0; border-radius: 12px; background: #f1f3f9; }
.summary-tile span { display: block; margin-bottom: 5px; color: #646d7d; font-size: 11px; }
.summary-tile strong { color: #30384b; font-size: 13px; font-weight: 650; }
.splash-description { margin: 0 0 17px; color: #636c7b; font-size: 13px; line-height: 1.65; }
.splash-checklist { display: grid; gap: 10px; }
.splash-checklist div { display: flex; align-items: flex-start; gap: 9px; color: #505a6d; font-size: 12px; }
.splash-checklist i { color: #28664c; font-style: normal; font-weight: 800; }
.start-form { padding: 21px; border: 0; border-radius: 16px; background: #f1f3f9; }
.start-form h3 { margin-bottom: 5px; }
.start-form>p { margin: 0 0 16px; color: #626b7a; font-size: 12px; }
.start-form label, .modal-card label { display: block; margin: 12px 0 6px; color: #535d70; font-size: 12px; font-weight: 650; }
.start-form .field { background: #fff; }
.start-form .button { width: 100%; margin-top: 17px; }
.form-footnote { margin: 10px 0 0; color: #727b8a; text-align: center; font-size: 11px; }
.form-error { margin-top: 8px; color: #b3261e; font-size: 12px; }
.flow-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 5px 0 20px; }
.flow-heading h1 { margin: 0; color: #202638; font: 700 27px/1.2 var(--display); letter-spacing: -.55px; }
.flow-heading p { margin: 7px 0 0; color: #646d7c; font-size: 13px; }
.deadline-badge { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; color: #644a11; background: #fff0cc; font-size: 12px; }
.deadline-badge strong { color: #59400d; }
.progress-panel { margin-bottom: 22px; padding: 15px 18px; border: 1px solid #e3e6ef; border-radius: 15px; background: #fff; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #555e70; font-size: 12px; }
.progress-row strong { color: #39445d; font-size: 12px; font-weight: 650; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e5e8f1; }
.progress-fill { height: 100%; border-radius: inherit; background: #405f9f; transition: width .25s; }
.section-selector-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 13px; }
.section-picker { display: flex; align-items: center; gap: 12px; min-width: 0; }
.section-picker label { color: #687182; font-size: 11px; font-weight: 750; letter-spacing: .8px; }
.section-picker select { max-width: 420px; min-width: 220px; height: 44px; padding: 0 38px 0 14px; border: 1px solid #777f8e; border-radius: 8px; background: #fff; color: #30394d; font-size: 13px; }
.section-index { color: #667083; font-size: 12px; font-weight: 600; }
.section-page-title { margin: 10px 0 4px; color: #242b3b; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.section-description { margin: 0 0 16px; color: #636d7c; font-size: 13px; }
.question-stack { display: grid; gap: 13px; }
.question-card {
  min-width: 0; padding: 20px 21px; border: 1px solid #e1e4ed; border-radius: 16px;
  background: #fff; box-shadow: 0 1px 3px rgba(31,41,67,.035);
  transition: border-color .2s, box-shadow .2s, opacity .2s;
  animation: cardEnter .35s both;
}
.question-card:hover, .question-card:focus-within { border-color: #bdc9e3; box-shadow: 0 2px 8px rgba(31,41,67,.08); }
.question-card.invalid { border-color: #ba1a1a; box-shadow: 0 0 0 2px rgba(186,26,26,.10), 0 0 22px rgba(186,26,26,.15); animation: rubberBand .78s both; }
.question-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.question-title { margin: 0; color: #282e3d; font: 650 15px/1.45 var(--display); }
.question-number { margin-right: 9px; color: #69758d; font-size: 11px; font-weight: 750; }
.required-star { margin-left: 3px; color: #ba1a1a; }
.question-help { margin: 5px 0 0; color: #666f7e; font-size: 12px; }
.question-required { padding: 5px 10px; border-radius: 999px; background: #ffedc2; color: #735000; font-size: 10px; font-weight: 750; white-space: nowrap; }
.question-required.immediate { background: #ffdfdc; color: #9b2926; }
.control-stack { display: grid; gap: 17px; }
.control-unit { min-width: 0; }
.control-label { display: block; margin: 0 0 7px; color: #535d70; font-size: 12px; font-weight: 650; }
.field {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #747b89;
  border-radius: 7px; outline: 0; background: #fff; color: #292f3e; font-size: 14px;
  transition: border-color .18s, box-shadow .18s;
}
.field:focus { border-color: #405f9f; box-shadow: 0 0 0 1px #405f9f; background: #fff; }
.field::placeholder { color: #777f8c; }
textarea.field { min-height: 100px; resize: vertical; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.input-suffix { color: #535d70; font-size: 14px; }
.choice-list { display: grid; gap: 2px; }
.choice-item { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 5px 10px; border-radius: 9px; color: #373f50; font-size: 14px; cursor: pointer; }
.choice-item:hover { background: #f3f4f9; }
.choice-item input { width: 19px; height: 19px; margin: 0; accent-color: var(--md-primary); }
.inline-choices { display: flex; align-items: stretch; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px 1px 5px; }
.gel-choice {
  position: relative; min-width: 86px; flex: 1; min-height: 44px; overflow: hidden;
  padding: 9px 16px; border: 1px solid #777f8e; border-radius: 999px;
  background: #fff; color: #4e586b; font-size: 13px; font-weight: 650; white-space: nowrap;
  transition: background .22s, color .22s, border-color .22s, box-shadow .22s;
}
.gel-choice:before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 120%,rgba(255,255,255,.52),transparent 60%); opacity: 0; transform: scale(.7); transition: .3s; }
.gel-choice:after { content: ""; position: absolute; left: 50%; top: 100%; width: 150%; height: 100%; border-radius: 50%; background: rgba(255,255,255,.16); transform: translate(-50%,-15%) scale(.2); transition: transform .38s cubic-bezier(.22,.8,.25,1); }
.gel-choice span { position: relative; z-index: 1; }
.gel-choice:hover { background: #f1f3fa; border-color: #516da6; }
.gel-choice.selected { border-color: #405f9f; background: #dce2ff; color: #1b376c; box-shadow: inset 0 0 0 1px rgba(64,95,159,.14); }
.gel-choice.selected:before { opacity: 1; transform: scale(1.2); }
.gel-choice.selected:after { transform: translate(-50%,-55%) scale(1.2); }
.question-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 17px; padding-top: 13px; border-top: 1px solid #eceef3; }
.tool-button { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: #405f9f; font-size: 12px; font-weight: 650; }
.tool-button:hover { background: #eef1fb; color: #283f78; }
.tool-count { padding: 2px 7px; border-radius: 999px; background: #dce2ff; color: #344e89; font-size: 10px; }
.question-optional { margin-left: auto; color: #707989; font-size: 11px; }
.note-entry, .action-entry { margin-top: 10px; padding: 12px; border: 1px solid #e4e7ef; border-radius: 12px; background: #f2f3f9; }
.note-entry textarea { min-height: 70px; }
.note-entry-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.saved-notes { margin-top: 10px; }
.saved-note { padding: 8px 0; border-bottom: 1px solid #eceef3; color: #515d72; font-size: 12px; }
.saved-note span { color: #747d8c; }
.action-chip { display: flex; align-items: center; gap: 9px; margin: 7px 0; color: #4b566a; font-size: 12px; }
.action-chip i { width: 8px; height: 8px; border-radius: 50%; background: #d39b38; }
.upload-zone { padding: 19px; border: 1px dashed #8c94a3; border-radius: 14px; background: #f8f9fc; color: #667082; text-align: center; font-size: 12px; }
.upload-zone strong { display: block; margin: 5px 0; color: #303a50; font-size: 13px; }
.upload-zone input { max-width: 100%; font-size: 12px; }
.media-preview { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.media-preview img { max-width: 175px; max-height: 140px; object-fit: contain; border: 1px solid #dfe3eb; border-radius: 10px; background: #eef0f5; transition: transform .25s; }
.media-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.mini-button { min-height: 36px; padding: 7px 13px; border: 1px solid #777f8e; border-radius: 999px; background: transparent; color: #43516a; font-size: 12px; font-weight: 600; }
.mini-button:hover { background: #eef1f9; }
.text-button { min-height: 40px; padding: 7px 13px; border: 0; border-radius: 999px; background: transparent; color: #405f9f; font-size: 13px; font-weight: 650; }
.text-button:hover { background: #eef1fb; }

/* Signature field: the pad itself exists only inside the modal */
.signature-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 76px; padding: 12px 14px; border: 1px dashed #9aa2b1; border-radius: 12px; background: #f8f9fc; }
.signature-summary.has-signature { border-style: solid; border-color: #c9cedb; background: #f4f6fb; }
.signature-placeholder-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e3e8f8; color: #405f9f; font-size: 20px; }
.signature-placeholder-copy { flex: 1; color: #636d7e; font-size: 13px; }
.signature-thumbnail { width: 130px; height: 48px; object-fit: contain; padding: 3px 8px; border: 1px solid #d7dbe5; border-radius: 7px; background: #fff; }
.signature-summary-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.signature-open-button { min-height: 38px; padding: 8px 16px; font-size: 12px; }
.signature-modal { width: min(760px, 100%); max-height: 94vh; padding: 28px; border-radius: 28px; }
.signature-modal-heading { display: flex; align-items: flex-start; gap: 14px; padding-right: 34px; }
.signature-dialog-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: #dce2ff; color: #304b86; font-size: 22px; }
.signature-modal-heading h2 { margin: 1px 0 5px; color: #242b3b; font-size: 21px; }
.signature-modal-heading p { margin: 0; color: #626c7c; font-size: 13px; line-height: 1.5; }
.signature-canvas-wrap { position: relative; margin-top: 23px; overflow: hidden; border: 1px solid #aeb5c3; border-radius: 13px; background: #fff; }
.signature-modal-canvas { position: relative; z-index: 1; display: block; width: 100%; height: clamp(175px, 32vh, 250px); touch-action: none; cursor: crosshair; }
.signature-baseline { position: absolute; z-index: 0; right: 28px; bottom: 48px; left: 28px; border-bottom: 1px dashed #c2c7d1; pointer-events: none; }
.signature-hint { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: rgba(246,247,251,.88); color: #858c99; font-size: 10px; pointer-events: none; }
.signature-dialog-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.signature-dialog-note { color: #737b89; font-size: 11px; }

/* Warnings, navigation footer and completion */
.section-warning { display: none; margin-bottom: 13px; padding: 12px 15px; border: 1px solid #e7a6a1; border-radius: 12px; background: #ffdad6; color: #8c1d18; font-size: 13px; }
.section-warning.show { display: block; animation: fadeUp .25s; }
.flow-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; padding: 19px 0 8px; }
.flow-footer .button { min-width: 125px; }
.keyboard-hint { color: #70798a; font-size: 11px; }
.swipe-hint { position: fixed; right: 18px; bottom: 82px; z-index: 30; padding: 11px 15px; border-radius: 14px; background: #263d70; color: #fff; box-shadow: 0 4px 14px rgba(24,38,72,.2); font-size: 12px; animation: fadeUp .25s; }
.swipe-arrows { position: fixed; inset: 50% 12px auto; z-index: 8; display: flex; justify-content: space-between; pointer-events: none; }
.swipe-arrows span { width: 38px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(64,95,159,.12); color: #405f9f; font-size: 23px; opacity: .9; }
.completion-panel { padding: 22px 10px 14px; text-align: center; }
.complete-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: #d9f2e2; color: #1f6643; font-size: 30px; }
.completion-panel h2 { margin: 0; color: #202638; font: 700 23px var(--display); }
.completion-panel p { max-width: 390px; margin: 9px auto 20px; color: #616b7a; font-size: 13px; }
.completion-stats { display: flex; justify-content: center; gap: 27px; margin: 0 0 23px; }
.completion-stats strong { display: block; color: #2d3850; font: 700 22px var(--display); }
.completion-stats span { color: #707989; font-size: 11px; }

/* Dialogs, snackbars and empty states */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(20,26,41,.36); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: min(560px,100%); max-height: 92vh; overflow: auto; padding: 28px; border-radius: 24px; background: #f8f9fc; box-shadow: 0 12px 34px rgba(17,25,43,.22); animation: modalIn .22s both; }
.modal-close { position: absolute; top: 13px; right: 13px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #535c6d; font-size: 23px; }
.modal-close:hover { background: #e9ebf2; }
.modal-card h2 { margin: 0 38px 8px 0; color: #242b3b; font: 700 21px var(--display); }
.modal-card p { margin: 0 0 18px; color: #626c7c; font-size: 13px; }
.modal-card .field { background: #fff; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.toast-region { position: fixed; top: 83px; right: 22px; z-index: 90; display: grid; gap: 8px; }
.toast { padding: 13px 17px; border-radius: 13px; background: #303b55; color: #fff; box-shadow: 0 4px 14px rgba(22,31,52,.18); font-size: 13px; animation: fadeUp .25s; }
.toast.error { background: #8c1d18; }
.empty-state { padding: 40px 22px; border: 1px dashed #c5cad5; border-radius: 16px; background: #f7f8fb; color: #667082; text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: #343d50; }
.scanner-video { width: 100%; max-height: 270px; border-radius: 12px; background: #111827; object-fit: cover; }
.scanner-status { margin-top: 8px; color: #646e7f; font-size: 12px; }

@keyframes cardEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rubberBand { 0% { transform: scale3d(1,1,1); } 20% { transform: scale3d(1.035,.965,1); } 35% { transform: scale3d(.97,1.03,1); } 50% { transform: scale3d(1.02,.98,1); } 65% { transform: scale3d(.99,1.01,1); } 80% { transform: scale3d(1.005,.995,1); } 100% { transform: scale3d(1,1,1); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1050px) {
  .sidebar { width: 236px; flex-basis: 236px; }
  .topbar, .bottom-bar { padding-left: 25px; padding-right: 25px; }
  .view { padding-left: 25px; padding-right: 25px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .deadline-copy { min-width: 95px; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 284px; transform: translateX(-103%); transition: transform .24s ease; box-shadow: 12px 0 30px rgba(17,25,43,.15); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; }
  .topbar { height: 60px; gap: 8px; padding: 0 13px; }
  .breadcrumbs { margin-right: auto; gap: 8px; font-size: 12px; }
  .topbar-actions { gap: 4px; }
  .connection-status, .small-avatar { display: none; }
  .view { padding: 25px 15px 34px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { gap: 9px; margin-bottom: 28px; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-value { font-size: 27px; }
  .inspection-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; }
  .search-box { width: auto; min-width: 0; flex: 1; }
  .filter-select { min-width: 132px; }
  .inspection-card { grid-template-columns: 44px minmax(0,1fr); gap: 12px; padding: 14px; }
  .inspection-icon { width: 44px; height: 44px; }
  .inspection-right { grid-column: 2; justify-content: space-between; padding-top: 11px; margin-top: 2px; border-top: 1px solid #eceef3; }
  .deadline-copy { min-width: 0; text-align: left; }
  .card-action { min-width: 108px; }
  .inspection-description { white-space: normal; }
  .bottom-bar { min-height: 40px; padding: 0 15px; font-size: 10px; }
  .splash-content { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .splash-banner { padding: 24px 22px; }
  .splash-banner h1 { font-size: 24px; }
  .flow-view { padding-top: 18px; }
  .flow-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .deadline-badge { align-self: flex-start; }
  .section-selector-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-picker { width: 100%; align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-picker select { width: 100%; max-width: 100%; }
  .question-card { padding: 16px; }
  .flow-footer { position: sticky; bottom: 0; z-index: 10; padding: 11px 0 max(11px,env(safe-area-inset-bottom)); background: rgba(247,248,252,.95); backdrop-filter: blur(12px); }
  .flow-footer .button { min-width: 102px; }
  .keyboard-hint { display: none; }
  .toast-region { top: 69px; right: 12px; left: 12px; }
  .toast { text-align: center; }
  .completion-stats { gap: 17px; }
  .signature-modal { padding: 23px 18px; }
  .signature-modal-heading { padding-right: 24px; }
  .signature-dialog-note { display: none; }
}
@media (max-width: 420px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-card { padding: 12px; }
  .metric-top { font-size: 11px; }
  .metric-note { font-size: 10px; }
  .toolbar-controls { gap: 6px; }
  .filter-select { min-width: 112px; padding: 0 7px; font-size: 11px; }
  .inline-choices { gap: 6px; }
  .gel-choice { min-width: 70px; padding: 8px 10px; font-size: 11px; }
  .splash-summary { grid-template-columns: 1fr 1fr; }
  .question-heading { gap: 8px; }
  .question-required { font-size: 9px; }
  .completion-stats strong { font-size: 19px; }
  .signature-summary { align-items: flex-start; }
  .signature-summary-actions { width: 100%; margin-left: 0; }
  .signature-thumbnail { width: 100px; }
  .signature-modal-heading { gap: 10px; }
  .signature-dialog-icon { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* v0.3 refinements: readable type, filled Material controls and card focus */
:root {
  --font: Verdana, "Trebuchet MS", Arial, sans-serif;
  --display: Verdana, "Trebuchet MS", Arial, sans-serif;
}
body {
  font-family: var(--font);
  line-height: 1.65;
  letter-spacing: .006em;
}

/* Filled, tactile Material-style buttons */
.button {
  min-height: 44px;
  padding: 11px 19px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: .005em;
  box-shadow: 0 1px 2px rgba(25, 42, 78, .08);
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .16s ease;
}
.button:active { transform: scale(.975); box-shadow: inset 0 1px 3px rgba(21, 34, 64, .17); }
.button-primary {
  color: #fff;
  background: linear-gradient(180deg, #496db0 0%, #365a9b 100%);
  box-shadow: 0 3px 8px rgba(48, 77, 137, .22);
}
.button-primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #3e64a8 0%, #2f508e 100%);
  box-shadow: 0 5px 12px rgba(48, 77, 137, .25);
}
.button-quiet, .button-outline {
  color: #344c7a;
  background: #e8ecf7;
  border: 0;
  box-shadow: none;
}
.button-quiet:hover, .button-outline:hover { color: #263f70; background: #dce4f5; }
.button-tonal {
  color: #29477f;
  background: #dce5fb;
  border: 0;
  box-shadow: none;
}
.button-tonal:hover { color: #1f3c72; background: #cedcf8; }
.button-text {
  color: #365b9c;
  background: #edf1fb;
  border: 0;
  box-shadow: none;
}
.button-text:hover { color: #294a87; background: #e0e8f8; }
.button-disabled, .button:disabled {
  color: #858d9b;
  background: #eceef3;
  box-shadow: none;
  cursor: not-allowed;
}
.tool-button, .mini-button, .text-button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #e9eef9;
  color: #365991;
  font-family: var(--font);
  font-weight: 700;
  box-shadow: none;
  transition: background .18s, color .18s, transform .16s;
}
.tool-button:hover, .mini-button:hover, .text-button:hover { background: #dce6f8; color: #294b86; }
.tool-button:active, .mini-button:active, .text-button:active { transform: scale(.97); }

/* Filled fields and selection controls */
.field, .filter-select, .section-picker select {
  border: 0;
  border-bottom: 2px solid #8992a4;
  border-radius: 10px 10px 4px 4px;
  background: #f0f2f8;
  color: #252f46;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.field:hover, .filter-select:hover, .section-picker select:hover { background: #e9edf6; }
.field:focus, .filter-select:focus, .section-picker select:focus {
  border-bottom: 2px solid #405f9f;
  background: #e8edfb;
  box-shadow: 0 2px 0 rgba(64,95,159,.10);
  outline: none;
}
.field::placeholder { color: #747e91; opacity: 1; }
.search-box {
  border: 0;
  border-bottom: 2px solid #8992a4;
  border-radius: 10px 10px 4px 4px;
  background: #f0f2f8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.search-box:focus-within { border-bottom-color: #405f9f; background: #e8edfb; }
.search-box input::placeholder { color: #747e91; }
.choice-item { transition: background .16s, color .16s; }
.choice-item:has(input:checked) { color: #243f75; background: #e6ebfa; }
.choice-item input { width: 20px; height: 20px; accent-color: #405f9f; }

/* Softer filled inline answers retain the liquid / gel selection movement. */
.gel-choice {
  border: 1px solid transparent;
  border-radius: 13px;
  background: #edf0f7;
  color: #46536b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.gel-choice:hover { border-color: #b9c8e7; background: #e4eaf7; color: #2d477b; }
.gel-choice.selected {
  border-color: #365b9b;
  color: #fff;
  background: linear-gradient(135deg, #5278bd 0%, #365b9b 72%, #2e528f 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.23), 0 3px 8px rgba(48,77,137,.18);
}
.gel-choice.selected:before {
  background: radial-gradient(circle at 50% 110%, rgba(255,255,255,.46), transparent 64%);
}
.gel-choice.selected:after { background: rgba(255,255,255,.20); }
.gel-choice:focus-visible { outline: 3px solid rgba(64,95,159,.30); outline-offset: 2px; }
.upload-zone { border: 1px dashed #9aa9c4; background: #f0f3fa; }
.signature-summary { border-color: #9aa9c4; background: #f0f3fa; }

/* Footer classification for every question */
.question-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #e8ebf2;
}
.question-required {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.question-required.required { color: #294a80; background: #e0e9fb; }
.question-required.immediate { color: #8c2927; background: #ffe3df; }
.question-required.optional { color: #596477; background: #edf0f5; }
.question-footer-note { color: #747d8d; font-size: 11px; }

/* Card arrival: a slight skew and perspective settle, then the cards rest square. */
.inspection-card, .question-card {
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform;
  animation: cardSkewIn .48s cubic-bezier(.18,.72,.24,1) both;
}
.metric-card, .start-splash {
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  animation: cardSkewIn .48s cubic-bezier(.18,.72,.24,1) both;
}
.metric-card:nth-child(2) { animation-delay: .045s; }
.metric-card:nth-child(3) { animation-delay: .09s; }
.metric-card:nth-child(4) { animation-delay: .135s; }
.inspection-card:nth-child(2), .question-card:nth-child(2) { animation-delay: .045s; }
.inspection-card:nth-child(3), .question-card:nth-child(3) { animation-delay: .09s; }
.inspection-card:nth-child(4), .question-card:nth-child(4) { animation-delay: .135s; }
.inspection-card:nth-child(5), .question-card:nth-child(5) { animation-delay: .18s; }
.inspection-card:nth-child(6), .question-card:nth-child(6) { animation-delay: .225s; }
.question-card { transition: border-color .2s, box-shadow .2s, opacity .2s, transform .2s; }
.question-card:hover, .question-card:focus-within { transform: translateY(-2px); }
.inspection-card:not(:hover):not(:focus-within),
.question-card:not(:hover):not(:focus-within) { opacity: .75; }
.inspection-card:hover, .inspection-card:focus-within,
.question-card:hover, .question-card:focus-within { opacity: 1; }

@keyframes cardSkewIn {
  0% { transform: perspective(900px) translateY(17px) skewX(-3deg) skewY(1.4deg) rotateX(3deg) scale(.985); }
  62% { transform: perspective(900px) translateY(-2px) skewX(.7deg) skewY(-.35deg) rotateX(-.5deg) scale(1.003); }
  82% { transform: perspective(900px) translateY(1px) skewX(-.25deg) skewY(.12deg) rotateX(.15deg) scale(.999); }
  100% { transform: perspective(900px) translateY(0) skew(0) rotateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .inspection-card, .question-card { will-change: auto; }
}
