.app-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 22px 28px 18px;
}

body {
  margin: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 12px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.workspace-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.workspace-nav button {
  min-height: 47px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font: 680 13px/1 var(--sans);
  cursor: pointer;
}

.workspace-nav button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.workspace-nav button.active {
  color: var(--ink);
  border-bottom-color: var(--attack);
}

.tab-panel {
  min-width: 0;
}

.tab-panel[hidden] {
  display: none;
}

.static-controls {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(280px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

input,
select,
.button,
.citation-copy {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font: 620 13px/1.2 var(--sans);
}

input,
select {
  width: 100%;
}

.button,
.citation-copy {
  cursor: pointer;
}

.button:hover,
.citation-copy:hover {
  border-color: var(--cobalt);
}

.button.primary {
  color: #ffffff;
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.button.secondary {
  background: var(--surface);
}

.static-explorer {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.static-filter {
  display: grid;
  gap: 13px;
  position: sticky;
  top: 12px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 8px;
  margin-top: 3px;
}

.table-shell {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.results-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table th,
.results-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.results-table th {
  color: var(--muted);
  background: #f7f9f8;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.results-table td {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.results-table th:nth-child(1) { width: 112px; }
.results-table th:nth-child(2) { width: 86px; }
.results-table th:nth-child(3) { width: 132px; }
.results-table th:nth-child(4) { width: 178px; }
.results-table th:nth-child(5) { width: 138px; }
.results-table th:nth-child(6) { width: 86px; }
.results-table th:nth-child(7) { width: auto; }

.results-table tbody tr {
  cursor: pointer;
}

.results-table tbody tr:hover,
.results-table tbody tr.selected {
  background: var(--cobalt-soft);
}

.row-id-button {
  padding: 0;
  color: var(--cobalt);
  background: transparent;
  border: 0;
  font: 700 10px/1.3 var(--mono);
  cursor: pointer;
}

.row-text-cell {
  color: var(--ink) !important;
  font-size: 12px !important;
}

.label-chip {
  display: inline-block;
  padding: 4px 6px;
  border: 1px solid;
  border-radius: 3px;
  font: 700 9px/1 var(--mono);
}

.label-chip.benign {
  color: var(--benign);
  background: var(--benign-soft);
  border-color: #a9d8cc;
}

.label-chip.attack {
  color: var(--attack);
  background: var(--attack-soft);
  border-color: #e7b5bd;
}

.mobile-results {
  display: none;
}

.mobile-row {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 5px;
  cursor: pointer;
}

.mobile-row.benign { border-left-color: var(--benign); }
.mobile-row.attack { border-left-color: var(--attack); }

.mobile-row header,
.mobile-row footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-row p {
  margin: 12px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.48;
}

.mobile-row footer {
  color: var(--muted);
  font: 600 9px/1.35 var(--mono);
}

.citation-copy {
  min-height: 34px;
  color: #ffffff;
  background: transparent;
  border-color: #47514e;
  font-family: var(--mono);
  font-size: 10px;
}

.app-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 14px;
  color: #ffffff;
  background: var(--ink);
  border: 1px solid #38413f;
  border-radius: 5px;
  box-shadow: 0 10px 26px rgba(18, 24, 23, 0.18);
  font: 650 11px/1.4 var(--mono);
}

.app-status.success {
  color: #d5f3eb;
  border-color: #287e6e;
}

.app-status.error {
  color: #ffe1e5;
  border-color: var(--attack);
}

.app-status[hidden] {
  display: none;
}

.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 18px 20px;
  }

  .static-explorer {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px 12px 16px;
  }

  .workspace-nav button {
    min-height: 44px;
    padding: 0 7px;
    font-size: 11px;
  }

  .static-controls,
  .static-explorer {
    grid-template-columns: 1fr;
  }

  .static-filter {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .static-filter label:first-child,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .table-shell {
    display: none;
  }

  .mobile-results {
    display: grid;
    gap: 9px;
    margin-top: 12px;
  }

  .app-footer nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .static-filter {
    grid-template-columns: 1fr;
  }

  .static-filter label:first-child,
  .filter-actions {
    grid-column: auto;
  }

  .row-detail dl {
    grid-template-columns: 1fr;
  }
}
