:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f3f5;
  color: #171717;
  --red: #d71920;
  --black: #111111;
  --line: #d7dade;
  --muted: #646a73;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f2f3f5;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.topbar {
  min-height: 74px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: var(--black);
  border-radius: 8px;
  border-bottom: 4px solid var(--red);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
}

.brand img {
  height: 48px;
  width: auto;
  background: #ffffff;
  border-radius: 4px;
  padding: 4px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 6px;
}

nav a:hover {
  background: #2a2a2a;
}

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

h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.panel,
.summary,
.table-wrap {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.06);
}

.panel {
  padding: 20px;
}

.analyze-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #273746;
}

input,
select,
button,
textarea {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid #aeb4bc;
  padding: 8px 10px;
  font: inherit;
}

button,
.downloads a,
.button-link {
  background: var(--red);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

button {
  padding-inline: 22px;
}

button:hover,
.downloads a:hover,
.button-link:hover {
  background: #af1117;
}

.alerts {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff4f4;
  border: 1px solid #ef9a9a;
}

.alerts.success {
  background: #eefaf1;
  border-color: #78c28a;
  color: #185c2b;
}

.alerts p {
  margin: 0;
}

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f7f7f7;
  border-left: 4px solid var(--red);
  color: #2d2d2d;
  font-weight: 700;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
  padding: 18px;
}

.summary div {
  display: grid;
  gap: 4px;
}

.label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.summary strong {
  font-size: 1.1rem;
}

.downloads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 8px 14px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e6ebf0;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th:nth-child(7),
td:nth-child(7) {
  text-align: center;
}

th {
  background: var(--black);
  color: #ffffff;
  font-size: 0.84rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fff7f7;
}

input[type="checkbox"][disabled] {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  display: block;
  margin: 0 auto;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
  padding: 28px;
}

.login-panel img {
  width: 118px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.login-help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

textarea {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
}

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

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border-radius: 6px;
  padding: 8px 14px;
}

.list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row:hover {
  background: #fff7f7;
}

.list-row span {
  color: var(--muted);
}

.narrow {
  max-width: 560px;
}

.danger {
  background: #5f1717;
}

.danger:hover {
  background: #421010;
}

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

.chart-panel {
  padding: 18px;
}

.chart-panel h2,
.panel h2 {
  margin-bottom: 14px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 44px;
  gap: 10px;
  align-items: center;
}

.bar-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.bar-track {
  height: 18px;
  background: #eceff3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  min-width: 2px;
  height: 100%;
  background: var(--red);
}

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

.simple-table table {
  min-width: 620px;
}

@media (max-width: 820px) {
  .analyze-form,
  .summary,
  .topbar,
  .list-row,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .list-row {
    flex-direction: column;
    align-items: stretch;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    margin-block: 18px;
  }

  nav {
    justify-content: flex-start;
  }
}

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

  .topbar nav,
  .downloads,
  .button-link {
    display: none !important;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .topbar,
  .panel,
  .summary,
  .table-wrap,
  .chart-panel {
    box-shadow: none;
    break-inside: avoid;
  }

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