:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-strong: #f0efe8;
  --ink: #17211c;
  --muted: #617067;
  --line: #d9ded5;
  --brand: #106b55;
  --brand-dark: #0b4d3d;
  --accent: #d94f30;
  --focus: #1e7fd6;
  --shadow: 0 18px 50px rgba(23, 33, 28, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 0;
}

.workspace {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.audit-form {
  display: grid;
  gap: 16px;
}

.form-panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.span-2 {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(30, 127, 214, 0.15);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-grid span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px 10px;
  font-weight: 650;
}

.checkbox-grid input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand);
}

.action-row {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 0;
  background: linear-gradient(rgba(247, 246, 241, 0), var(--bg) 28%);
}

button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--brand);
}

.result-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
  border-radius: 0;
  padding: 24px;
  box-shadow: none;
}

pre {
  min-height: 70vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101714;
  color: #e8f4ee;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.is-hidden {
  display: none !important;
}

.result-message {
  display: grid;
  gap: 14px;
  min-height: 70vh;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.result-message h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.05;
}

.result-message p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.result-actions a {
  text-decoration: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 28px 28px;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    display: grid;
  }

  .section-heading p {
    text-align: left;
  }

  .form-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-panel {
    margin: 0 18px 18px;
    padding: 18px;
  }
}
