:root {
  --bg: #f2f5f7;
  --panel: #0f1722;
  --panel-soft: #182334;
  --text: #e8eef6;
  --muted: #9fb3c8;
  --accent: #11c5bf;
  --danger: #eb5757;
  --ok: #27ae60;
  --line: #d6dde6;
  --ink: #1e2a36;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #edf6ff, var(--bg));
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 410px 1fr;
}

.panel {
  background: linear-gradient(170deg, var(--panel), var(--panel-soft));
  color: var(--text);
  padding: 18px;
  overflow-y: auto;
  border-right: 1px solid #24354a;
}

.panel-header h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.panel-header p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  border: 1px solid #29405a;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  background: #0b141f;
  color: var(--text);
  border: 1px solid #314d6c;
  border-radius: 8px;
  padding: 8px 10px;
}

.field.inline-check {
  flex-direction: row;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

.grid-two,
.grid-three {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

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

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  border: 1px solid #35557a;
  background: #143051;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-wide {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #062426;
  border-color: #0cb0ab;
}

.btn-danger {
  background: #4d1f29;
  border-color: #6d2c3a;
}

.list {
  margin-top: 8px;
  max-height: 110px;
  overflow-y: auto;
  border: 1px dashed #385373;
  border-radius: 8px;
  padding: 6px;
  font-size: 0.8rem;
  color: var(--text);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.list-item:last-child {
  border-bottom: none;
}

.mini-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #6a2f41;
  background: #572133;
  color: #ffd8e2;
  cursor: pointer;
}

.checks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 0.85rem;
}

.hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.viewer-wrap {
  display: grid;
  grid-template-rows: minmax(340px, 1fr) 300px;
  min-width: 0;
}

#viewer {
  min-height: 320px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #eff7ff 0%, #f8fafc 70%);
}

.result-panel {
  overflow: auto;
  padding: 12px 16px 16px;
}

.result-panel h2 {
  margin: 2px 0 8px;
  font-size: 1rem;
}

.result-panel h3 {
  margin: 4px 0 6px;
  font-size: 0.9rem;
}

.summary {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

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

.table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

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

th,
td {
  border-bottom: 1px solid #e9edf2;
  padding: 6px 8px;
  text-align: right;
  white-space: nowrap;
}

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

.state-tracao {
  color: var(--ok);
  font-weight: 600;
}

.state-compressao {
  color: var(--danger);
  font-weight: 600;
}

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

  .panel {
    max-height: 45vh;
  }

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

