:root {
  --paper: #0b1014;
  --surface: #121a20;
  --surface-2: #18232b;
  --ink: #edf4f7;
  --muted: #97a9b2;
  --line: #26343d;
  --green: #27c481;
  --green-soft: rgba(39, 196, 129, 0.12);
  --amber: #f2b84b;
  --amber-soft: rgba(242, 184, 75, 0.13);
  --red: #f06072;
  --red-soft: rgba(240, 96, 114, 0.13);
  --blue: #4ab4e8;
  --blue-soft: rgba(74, 180, 232, 0.14);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 16% 8%, rgba(39, 196, 129, 0.12), transparent 28%),
    radial-gradient(circle at 80% 14%, rgba(74, 180, 232, 0.1), transparent 26%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

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

.app-header,
main,
.tabs,
.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 0 22px;
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.1rem, 4vw, 4.6rem);
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.1rem);
}

h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.lede {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.privacy-note {
  display: grid;
  gap: 3px;
  width: min(280px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 26, 32, 0.92);
  box-shadow: var(--shadow);
}

.privacy-note span,
.muted,
.app-footer {
  color: var(--muted);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  background: rgba(11, 16, 20, 0.9);
  backdrop-filter: blur(10px);
}

.tab,
.primary-action,
.secondary-action,
.danger-action,
.file-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
}

.tab.is-active,
.tab:focus-visible,
.tab:hover {
  background: var(--green);
  color: #06100c;
}

main {
  padding: 18px 0 36px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 35, 43, 0.96), rgba(18, 26, 32, 0.96));
  box-shadow: var(--shadow);
}

.metric {
  min-height: 116px;
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.metric small {
  color: var(--muted);
}

.panel {
  padding: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.template-panel {
  margin-bottom: 14px;
}

.template-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 35, 43, 0.96), rgba(18, 26, 32, 0.96));
  box-shadow: var(--shadow);
}

label,
fieldset {
  min-width: 0;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e151a;
  color: var(--ink);
  padding: 10px 11px;
}

input::placeholder,
textarea::placeholder {
  color: #70848e;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--blue-soft);
  border-color: var(--blue);
}

.wide {
  grid-column: 1 / -1;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checklist legend {
  padding: 0 6px;
  font-weight: 900;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.checklist input {
  width: 16px;
  height: 16px;
}

.primary-action,
.secondary-action,
.danger-action,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
}

.primary-action {
  background: var(--green);
  color: #06100c;
}

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

.danger-action {
  background: var(--red);
  color: #24070d;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.button-row,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row .primary-action,
.button-row .secondary-action,
.button-row .danger-action {
  flex: 0 0 auto;
}

.filters {
  margin-bottom: 14px;
}

.filters input,
.filters select,
.filters label {
  flex: 1 1 220px;
}

.summary-list,
.warning-list,
.review-list {
  display: grid;
  gap: 10px;
}

.summary-item,
.warning-item,
.review-item {
  padding: 11px;
  border-radius: 8px;
  background: var(--green-soft);
}

.warning-item {
  background: var(--amber-soft);
}

.warning-item.critical {
  background: var(--red-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #111a20;
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.screenshot-preview {
  display: grid;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.screenshot-preview img,
.shot-thumb {
  display: block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.screenshot-preview img {
  width: min(460px, 100%);
}

.shot-thumb {
  width: 58px;
  height: 42px;
  object-fit: cover;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tiny-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.tiny-action.danger {
  border-color: rgba(240, 96, 114, 0.5);
  color: var(--red);
}

.report {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 35, 43, 0.98), rgba(18, 26, 32, 0.98));
  box-shadow: var(--shadow);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-card {
  padding: 13px;
  border-radius: 8px;
  background: #0e151a;
}

.report-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.danger-zone {
  margin-top: 16px;
}

.app-footer {
  padding: 24px 0 36px;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .app-header,
  .section-heading,
  .two-column {
    display: grid;
  }

  .metrics-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .app-header,
  main,
  .tabs,
  .app-footer {
    width: min(100% - 20px, 1180px);
  }

  h1 {
    font-size: 2rem;
  }

  .metrics-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric,
  .form-grid,
  .report {
    padding: 14px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-header,
  .tabs,
  .view:not(.print-target),
  .app-footer,
  .no-print {
    display: none !important;
  }

  main,
  .print-target {
    display: block !important;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .report {
    border: 0;
    box-shadow: none;
  }
}
