:root {
  --ink: #ecf5ef;
  --ink-2: #c9d8cf;
  --muted: #8ea198;
  --paper: #07110d;
  --card: rgba(17, 31, 25, .82);
  --line: rgba(184, 214, 197, .14);
  --line-strong: rgba(201, 242, 95, .3);
  --green: #177455;
  --green-dark: #0f513c;
  --mint: rgba(201, 242, 95, .12);
  --lime: #c9f25f;
  --lime-bright: #d8ff72;
  --red: rgba(185, 66, 54, .22);
  --shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 22px 60px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 8% 2%, rgba(201, 242, 95, .12), transparent 32rem),
    radial-gradient(circle at 94% 38%, rgba(23, 116, 85, .2), transparent 38rem),
    linear-gradient(135deg, #091610 0%, #07110d 50%, #0b1813 100%);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  background-attachment: fixed;
}
button, input, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  position: relative;
  height: 92px;
  padding: 0 clamp(20px, 4vw, 60px);
  display: flex;
  align-items: center;
  gap: 15px;
  color: #fff;
  background:
    radial-gradient(circle at 78% -120%, rgba(201, 242, 95, .27), transparent 25rem),
    linear-gradient(112deg, rgba(8,20,15,.96) 0%, rgba(18,43,33,.94) 100%);
  border-bottom: 1px solid rgba(216, 255, 114, .45);
  box-shadow: 0 9px 30px rgba(15, 38, 29, .13);
  backdrop-filter: blur(20px) saturate(140%);
}
.topbar::after {
  content: "";
  position: absolute;
  left: clamp(20px, 4vw, 60px);
  right: clamp(20px, 4vw, 60px);
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lime), transparent 55%);
}
.topbar h1 {
  margin: 0;
  font: 800 19px/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.035em;
}
.eyebrow {
  margin: 0 0 4px;
  color: #a8beb3;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-weight: 800;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(145deg, var(--lime-bright), #b9e650);
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255,255,255,.75), 0 8px 22px rgba(201,242,95,.18);
  font: 800 21px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}
.save-status {
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: #c9d6d0;
  background: rgba(255,255,255,.055);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}
.save-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(201,242,95,.1);
}
.workspace-tabs {
  display: flex;
  gap: 8px;
  padding: 14px clamp(16px, 3vw, 44px) 0;
  background: rgba(7, 17, 13, .88);
}
.workspace-tab {
  min-height: 42px;
  padding: 10px 17px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 11px 11px 0 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.workspace-tab.active { color: #122018; background: var(--lime); border-color: var(--lime); }
.top-clear {
  min-height: 36px;
  padding: 8px 12px;
  color: #f4c9c4;
  background: rgba(185, 66, 54, .12);
  border: 1px solid rgba(232, 121, 109, .28);
}
.top-clear:hover { background: rgba(185, 66, 54, .22); }

.app-shell {
  width: min(1520px, 100%);
  margin: auto;
  padding: 34px clamp(16px, 3vw, 44px) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(400px, .84fr);
  gap: 28px;
  align-items: start;
}
.checklist-view { width: min(1100px, 100%); margin: auto; padding: 34px clamp(16px, 3vw, 44px) 80px; }
.checklist-card { min-height: 60vh; }
.checklist-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; }
.checklist-search { display: block; flex: 1; max-width: 520px; }
.checklist-progress { color: var(--lime); font-size: 11px; white-space: nowrap; }
.checklist-category { margin: 25px 0; }
.checklist-category h3 { margin: 0 0 10px; color: #8fa399; font-size: 10px; text-transform: uppercase; letter-spacing: .15em; }
.checklist-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checklist-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 13px; color: #c8d6cf; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 700; }
.checklist-item:hover { border-color: rgba(201,242,95,.42); background: rgba(201,242,95,.075); }
.checklist-item:has(input:checked) { color: #fff; background: linear-gradient(145deg, #1d7155, #12533e); border-color: var(--green-dark); }
.checklist-item input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--lime); }
.checklist-item:has(input:checked) span { text-decoration: line-through; opacity: .78; }
.checklist-empty { padding: 35px 15px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 13px; text-align: center; font-size: 12px; }
.form-column { display: grid; gap: 22px; }
.card, .report-card {
  border: 1px solid rgba(208, 235, 220, .12);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  background: var(--card);
  backdrop-filter: blur(18px) saturate(120%);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.018) inset;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--lime), rgba(201,242,95,0));
  opacity: .9;
  box-shadow: 0 0 22px rgba(201,242,95,.25);
}
.section-heading, .report-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}
.section-heading > div, .report-heading > div { display: flex; align-items: center; gap: 11px; }
.section-heading h2, .report-heading h2 {
  margin: 0;
  font: 800 20px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.04em;
  color: #f4faf6;
}
.section-heading p {
  max-width: 250px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}
.step {
  min-width: 31px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--lime);
  background: var(--mint);
  border: 1px solid rgba(201,242,95,.24);
  border-radius: 9px;
  font: 800 9px Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em;
}
.step.light { color: var(--lime); background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.12); }

.inspection-grid, .inspection-contents { display: grid; grid-template-columns: 1fr 1fr; gap: 21px 18px; }
.inspection-contents { grid-column: 1 / -1; }
.service-details { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field-label, .textarea-label, .custom-entry label {
  display: block;
  margin: 0 0 9px;
  color: #cbd9d1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .015em;
}
.field-label small { margin-left: 5px; color: var(--muted); font-size: 9px; font-weight: 500; }
.textarea-label span { float: right; color: var(--muted); font-weight: 500; }
.segments { display: flex; flex-wrap: wrap; gap: 7px; }
.segment, .toggle-button {
  min-height: 41px;
  padding: 9px 13px;
  color: #b6c6bd;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.segment:hover, .toggle-button:hover {
  z-index: 1;
  color: #eef8f2;
  border-color: rgba(201,242,95,.42);
  background: rgba(201,242,95,.075);
  box-shadow: 0 8px 22px rgba(0,0,0,.18), 0 0 14px rgba(201,242,95,.05);
  transform: translateY(-1px);
}
.segment[aria-pressed=true], .toggle-button[aria-pressed=true] {
  color: #fff;
  background: linear-gradient(145deg, #1d7155, #12533e);
  border-color: var(--green-dark);
  box-shadow: inset 0 -2px rgba(201,242,95,.7), 0 7px 17px rgba(15,81,60,.17);
}
.segment.warning[aria-pressed=true] { background: linear-gradient(145deg, #a67912, #73510a); }
.segment.danger[aria-pressed=true] { background: linear-gradient(145deg, #a54035, #782d25); }
.custom-value { width: 100%; margin-top: 8px; }
.decision-label {
  display: block;
  margin: 11px 0 7px;
  color: #859088;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.decision-segments .segment { min-height: 34px; padding: 6px 10px; font-size: 10px; }

input, textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(4, 12, 8, .56);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #687a70; }
input:hover, textarea:hover { border-color: var(--line-strong); background: rgba(5,16,10,.72); }
input:focus, textarea:focus, button:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23,116,85,.13);
  outline: none;
}
textarea { resize: vertical; line-height: 1.55; }

.service-toolbar { display: flex; gap: 10px; margin-bottom: 22px; }
.search-field { position: relative; flex: 1; }
.search-field input { padding-right: 39px; }
.search-field span:last-child { position: absolute; right: 13px; top: 5px; color: #7b8982; font-size: 24px; }
.button {
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: 800 11px Inter, ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.025); }
.button:active { transform: translateY(0); }
.button-accent {
  color: #122018;
  background: linear-gradient(145deg, var(--lime-bright), #bee953);
  box-shadow: 0 7px 16px rgba(166,205,68,.18);
}
.button-dark { color: #fff; background: linear-gradient(145deg, #263a31, #15251e); }
.button-primary {
  color: #122018;
  background: linear-gradient(145deg, var(--lime-bright), #b9e84c);
  box-shadow: 0 8px 22px rgba(201,242,95,.14);
  font-size: 13px;
}
.button-secondary { color: #eff5f2; background: rgba(255,255,255,.105); border: 1px solid rgba(255,255,255,.17); }
.button-quiet { color: #afbeb7; background: transparent; border: 1px solid rgba(255,255,255,.12); }

.service-group { margin: 21px 0; }
.service-group h3 {
  margin: 0 0 10px;
  color: #7f9589;
  font: 800 9px Inter, ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.toggle-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-button::before { content: "+"; display: inline-block; margin-right: 7px; color: var(--green); font-weight: 900; }
.toggle-button[aria-pressed=true]::before { content: "✓"; color: var(--lime); }
.custom-entry { margin-top: 25px; padding-top: 22px; border-top: 1px dashed var(--line-strong); }
.custom-entry > div { display: flex; gap: 8px; }

.selected-panel {
  margin-top: 21px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(5,15,10,.5), rgba(27,49,39,.38));
  border: 1px solid rgba(201,242,95,.12);
  border-radius: 15px;
}
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title h3 { margin: 0; font: 800 12px Inter, ui-sans-serif, system-ui, sans-serif; }
.count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}
.empty-message { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.selected-list { display: grid; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; }
.selected-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(19,34,28,.025);
}
.drag-handle { color: #9ba59f; cursor: grab; text-align: center; }
.selected-row.dragging { opacity: .42; }
.selected-label { font-size: 11px; font-weight: 650; }
.mini-actions { display: flex; gap: 2px; }
.icon-button { width: 28px; height: 28px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.icon-button.remove:hover { color: #8b251d; background: var(--red); }
.textarea-label { margin-top: 19px; }

.report-column { position: sticky; top: 22px; }
.report-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(201,242,95,.1), transparent 21rem),
    linear-gradient(145deg, rgba(21,45,35,.98), rgba(6,17,12,.98));
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 28px 80px rgba(0,0,0,.42), 0 0 60px rgba(23,116,85,.08);
}
.report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--lime), #5db792, transparent 75%);
}
.report-heading { margin-bottom: 17px; }
.live-dot { color: #a9bbb2; font: 800 9px Inter, ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .11em; }
.live-dot i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(201,242,95,.09), 0 0 15px rgba(201,242,95,.3);
}
#reportOutput {
  height: calc(100vh - 277px);
  min-height: 530px;
  padding: 19px;
  color: #eaf1ed;
  background: rgba(5, 13, 10, .52);
  border-color: rgba(255,255,255,.105);
  border-radius: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.75;
  resize: vertical;
  box-shadow: inset 0 1px 12px rgba(0,0,0,.15);
}
.report-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-top: 12px; }
.action-status { min-height: 16px; margin: 8px 0 0; color: var(--lime); font-size: 10px; text-align: center; }
.privacy-note { margin: 5px 0 0; color: #7e9188; font-size: 9px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; max-width: 860px; }
  .report-column { position: static; }
  #reportOutput { height: 550px; min-height: 400px; }
}
@media (max-width: 620px) {
  .topbar { height: 78px; padding: 0 16px; }
  .topbar::after { left: 16px; right: 16px; }
  .brand-mark { width: 41px; height: 41px; border-radius: 12px; }
  .topbar h1 { font-size: 16px; }
  .save-status { padding: 8px; font-size: 0; }
  .save-status::before { margin: 0; }
  .top-clear { min-height: 40px; padding: 8px 10px; font-size: 9px; white-space: normal; line-height: 1.15; }
  .app-shell { padding: 17px 11px 50px; gap: 16px; }
  .workspace-tabs { padding: 10px 11px 0; }
  .workspace-tab { flex: 1; }
  .checklist-view { padding: 17px 11px 50px; }
  .checklist-items { grid-template-columns: 1fr; }
  .checklist-toolbar { align-items: stretch; flex-direction: column; }
  .form-column { gap: 16px; }
  .card, .report-card { padding: 18px; border-radius: 17px; }
  .section-heading { display: block; }
  .section-heading p { margin: 7px 0 0 42px; text-align: left; }
  .inspection-grid, .inspection-contents { grid-template-columns: 1fr; }
  .service-details { grid-template-columns: 1fr; }
  .service-toolbar, .custom-entry > div { flex-direction: column; }
  .button, .toggle-button, .segment { min-height: 44px; }
  .report-actions { grid-template-columns: 1fr; }
  #reportOutput { min-height: 430px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
