:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #64716a;
  --line: #dfe6e1;
  --surface: #ffffff;
  --canvas: #f4f7f4;
  --brand: #176b4d;
  --brand-dark: #0f513a;
  --brand-soft: #dff3e9;
  --critical: #a52a2a;
  --critical-soft: #f9e5e3;
  --danger: #c45416;
  --danger-soft: #fff0e1;
  --warning: #9b7200;
  --warning-soft: #fff6d6;
  --ok: #26734d;
  --ok-soft: #e2f3e9;
  --shadow: 0 18px 45px rgba(26, 47, 37, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(196, 225, 210, 0.72), transparent 26rem),
    var(--canvas);
}

button,
textarea,
input {
  font: inherit;
}

button,
.file-button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--brand);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.source-link {
  color: var(--muted);
  font-size: 0.88rem;
  text-underline-offset: 3px;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  max-width: 820px;
  padding: 72px 0 48px;
}

.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 0.99;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.input-panel,
.guide-panel,
.results {
  border: 1px solid rgba(223, 230, 225, 0.9);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: clamp(22px, 4vw, 38px);
}

.guide-panel {
  padding: 30px;
}

.panel-heading,
.results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

label {
  display: block;
  margin-bottom: 9px;
  font-size: 0.88rem;
  font-weight: 700;
}

code {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
}

textarea {
  width: 100%;
  min-height: 235px;
  resize: vertical;
  padding: 18px;
  border: 1px solid #cbd5ce;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfcfb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 107, 77, 0.12);
}

.input-actions {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
}

#software-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-button,
.text-button {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.file-button {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
}

.file-button:focus-within,
.text-button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(23, 107, 77, 0.28);
  outline-offset: 2px;
}

.text-button {
  padding: 5px;
  border: 0;
  background: transparent;
}

.entry-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 4px;
  color: white;
  background: var(--brand);
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-progress {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.loading .button-label {
  display: none;
}

.primary-button.loading .button-progress {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-message {
  min-height: 1.3em;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.form-message.error {
  color: var(--critical);
}

.status-guide {
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.status-guide li {
  display: grid;
  grid-template-columns: 12px 76px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.status-guide li:last-child {
  border-bottom: 0;
}

.status-guide li span:last-child,
.guide-note {
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot.critical { background: var(--critical); }
.status-dot.danger { background: var(--danger); }
.status-dot.warning { background: var(--warning); }
.status-dot.ok { background: var(--ok); }

.guide-note {
  margin-bottom: 0;
  font-size: 0.83rem;
  line-height: 1.55;
}

.results {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 38px);
}

.secondary-button {
  padding: 11px 16px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.summary-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 1.7rem;
}

.critical-card { background: var(--critical-soft); }
.danger-card { background: var(--danger-soft); }
.warning-card { background: var(--warning-soft); }
.ok-card { background: var(--ok-soft); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

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

th {
  color: var(--muted);
  background: #f7f9f7;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.status-pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.status-pill.critical { color: var(--critical); background: var(--critical-soft); }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.status-pill.ok { color: var(--ok); background: var(--ok-soft); }

.error-text {
  color: var(--critical);
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 0.8rem;
}

footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .hero {
    padding-top: 46px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .source-link {
    display: none;
  }

  .hero {
    padding: 34px 0 36px;
  }

  .panel-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }

  .input-actions {
    flex-wrap: wrap;
  }

  .entry-count {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
