:root {
  font-family: Arial, sans-serif;
  --bg: #eef2f7;
  --panel: #fff;
  --border: #d8e0ea;
  --primary: #2056d8;
  --text: #182230;
  --muted: #607086;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
header { padding: 20px 28px; background: #111b2e; color: white; }
header h1 { margin: 0; font-size: 1.5rem; }
header p { margin: 6px 0 0; color: #c6d2e5; }
main { display: grid; grid-template-columns: 370px 1fr; min-height: calc(100vh - 90px); }
aside { padding: 18px; background: white; border-right: 1px solid var(--border); overflow-y: auto; }
h2 { font-size: 1rem; margin: 18px 0 10px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: bold; }
input, select, button { font: inherit; }
input, select { width: 100%; padding: 9px; border: 1px solid #bdc8d6; border-radius: 7px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
#shape-fields { margin: 10px 0; }
#start-analysis { width: 100%; margin-top: 18px; padding: 13px; border: 0; border-radius: 8px; color: white; background: var(--primary); font-weight: bold; cursor: pointer; }
#message { min-height: 20px; color: var(--muted); }
.results { padding: 18px; min-width: 0; }
.tabs, .toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.tab, .toolbar button { padding: 9px 13px; border: 1px solid var(--border); border-radius: 7px; background: white; cursor: pointer; }
.tab.active { color: white; background: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
#viewer { height: 650px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.card, .chart, .report-box { background: white; border: 1px solid var(--border); border-radius: 10px; }
.card { padding: 15px; }
.card span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 7px; }
.card strong { font-size: 1.2rem; }
.chart { min-height: 350px; margin-bottom: 14px; }
.report-box { padding: 20px; }
.report-box table { width: 100%; border-collapse: collapse; }
.report-box th, .report-box td { text-align: left; padding: 9px; border-bottom: 1px solid var(--border); }
.ok { color: #147d48; }
.bad { color: #b42318; }
@media(max-width: 950px) {
  main { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--border); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  #viewer { height: 500px; }
}
@media(max-width: 600px) {
  .grid, .cards { grid-template-columns: 1fr; }
}

#start-analysis {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(32, 86, 216, 0.28);
}

.viewer-error {
  padding: 20px;
  color: #b42318;
  font-weight: bold;
}
