:root {
      --bg: #f4f6f9;
      --panel: #ffffff;
      --border: #d7dce4;
      --text: #20242a;
      --muted: #667085;
      --primary: #155eef;
      --primary-dark: #004ee0;
      --success: #217346;
      --danger: #b42318;
      --tab-bg: #eef2f7;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 16px;
      background: var(--bg);
      color: var(--text);
      font-family: Arial, Helvetica, sans-serif;
    }

    .app-title {
      max-width: 1500px;
      margin: 0 auto 12px;
      padding: 14px 16px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      font-size: 18px;
      font-weight: bold;
    }

    .layout {
      display: grid;
      grid-template-columns: 360px minmax(0, 1fr);
      gap: 14px;
      max-width: 1500px;
      margin: 0 auto;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
    }

    .left-panel {
      padding: 14px;
      align-self: start;
    }

    .left-panel h2 {
      margin: 0 0 12px;
      font-size: 17px;
    }

    .form-row {
      margin-bottom: 12px;
    }

    .form-row label {
      display: block;
      margin-bottom: 5px;
      font-size: 13px;
      font-weight: bold;
    }

    input,
    select,
    button {
      font: inherit;
    }

    input[type="text"],
    input[type="number"],
    select {
      width: 100%;
      padding: 8px 9px;
      border: 1px solid #aeb7c2;
      border-radius: 6px;
      background: white;
    }

    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .file-line {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
    }

    .file-name {
      min-height: 36px;
      padding: 8px 9px;
      overflow: hidden;
      border: 1px solid #aeb7c2;
      border-radius: 6px;
      background: #f8fafc;
      color: var(--muted);
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    button {
      padding: 9px 14px;
      border: 1px solid #8c96a3;
      border-radius: 6px;
      background: white;
      cursor: pointer;
    }

    button:hover {
      background: #f2f4f7;
    }

    .primary {
      border-color: var(--primary);
      background: var(--primary);
      color: white;
      font-weight: bold;
    }

    .primary:hover {
      background: var(--primary-dark);
    }

    .success {
      border-color: var(--success);
      background: var(--success);
      color: white;
      font-weight: bold;
    }

    .success:hover {
      filter: brightness(0.93);
    }

    .button-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin: 14px 0;
    }

    .dist-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 7px;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: #fafbfc;
    }

    .check-row {
      display: flex;
      gap: 7px;
      align-items: center;
      font-size: 13px;
    }

    .note {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .log {
      height: 200px;
      padding: 8px;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #0f172a;
      color: #d1fae5;
      font: 12px/1.45 Consolas, monospace;
      white-space: pre-wrap;
    }

    .workspace {
      min-width: 0;
      overflow: hidden;
    }

    .tabs {
      display: flex;
      gap: 4px;
      padding: 8px 8px 0;
      border-bottom: 1px solid var(--border);
      background: var(--tab-bg);
    }

    .tab-button {
      padding: 10px 16px;
      border: 1px solid transparent;
      border-bottom: none;
      border-radius: 7px 7px 0 0;
      background: transparent;
      font-weight: bold;
    }

    .tab-button.active {
      border-color: var(--border);
      background: white;
    }

    .tab-content {
      display: none;
      padding: 14px;
    }

    .tab-content.active {
      display: block;
    }

    .result-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
      gap: 14px;
    }

    .chart-wrap {
      position: relative;
      min-height: 360px;
    }

    .chart-wrap.small {
      min-height: 300px;
    }

    .section-title {
      margin: 0 0 8px;
      font-size: 15px;
      font-weight: bold;
    }

    .table-wrap {
      max-height: 380px;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 7px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }

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

    th {
      position: sticky;
      top: 0;
      background: #eef2f7;
      z-index: 1;
    }

    .summary {
      width: 100%;
      min-height: 210px;
      margin-top: 12px;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: #fafbfc;
      font: 12px/1.5 Consolas, monospace;
      white-space: pre-wrap;
    }

    .diag-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }

    .diag-full {
      grid-column: 1 / -1;
    }

    .metric-table {
      margin-top: 12px;
    }

    .status {
      min-height: 22px;
      margin-top: 10px;
      color: var(--danger);
      font-size: 13px;
      font-weight: bold;
    }

    @media (max-width: 1050px) {
      .layout {
        grid-template-columns: 1fr;
      }

      .result-grid,
      .diag-grid {
        grid-template-columns: 1fr;
      }

      .diag-full {
        grid-column: auto;
      }
    }
    .copyright-footer {
  margin-top: 24px;
  padding: 14px 20px;
  border-top: 1px solid #d7dce4;
  background: #f8fafc;
  color: #667085;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
