:root {
      --bg: #0b1020;
      --panel: #131a2e;
      --panel-2: #1a2340;
      --text: #ecf1ff;
      --muted: #9fb0e0;
      --accent: #7fb3ff;
      --good: #8df0b0;
      --warn: #ffd27a;
      --danger: #ff8f8f;
      --border: #2b3761;
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      overflow-x: hidden;
    }

    body {
      font-family: Arial, Helvetica, sans-serif;
      background: linear-gradient(180deg, #09101d 0%, #0f1730 100%);
      color: var(--text);
    }

    .wrap {
      width: 100%;
      max-width: 1280px;
      margin: 0 auto;
      padding: 24px;
    }

    h1, h2, h3, h4 {
      margin: 0 0 12px;
      line-height: 1.2;
    }

    p {
      color: var(--muted);
      line-height: 1.5;
      margin: 0 0 10px;
    }

    .grid {
      display: grid;
      grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
      gap: 20px;
      align-items: start;
    }

    .panel {
      background: rgba(19, 26, 46, 0.95);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 18px;
      box-shadow: 0 16px 40px rgba(0,0,0,0.25);
      min-width: 0;
      overflow: hidden;
    }

    .stack {
      display: grid;
      gap: 12px;
    }

    label {
      display: block;
      font-size: 14px;
      color: var(--text);
      margin-bottom: 6px;
    }

    input, select {
      width: 100%;
      max-width: 100%;
      padding: 12px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--panel-2);
      color: var(--text);
      font-size: 16px;
    }

    .two-col {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
    }

    .three-col {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
      gap: 12px;
      align-items: end;
    }

    .four-col {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    button {
      padding: 12px 14px;
      border: 0;
      border-radius: 12px;
      background: var(--accent);
      color: #081120;
      font-weight: bold;
      font-size: 16px;
      cursor: pointer;
    }

    button.secondary {
      background: #2b3761;
      color: var(--text);
    }

    button.danger {
      background: #4a2740;
      color: #ffd8e5;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .metric {
      background: var(--panel-2);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px;
      min-width: 0;
    }

    .metric .label {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 8px;
    }

    .metric .value {
      font-size: clamp(20px, 3vw, 24px);
      font-weight: bold;
      line-height: 1.15;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .table-wrap {
      width: 100%;
      overflow-x: auto;
      border-radius: 12px;
    }

    table {
      width: 100%;
      min-width: 720px;
      border-collapse: collapse;
      overflow: hidden;
      border-radius: 12px;
    }

    th, td {
      padding: 10px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      font-size: 14px;
      vertical-align: top;
    }

    th {
      color: var(--muted);
      background: rgba(255,255,255,0.03);
    }

    .note {
      font-size: 13px;
      color: var(--warn);
    }

    .footer-note {
      margin-top: 12px;
      font-size: 13px;
      color: var(--muted);
    }

    .member-card {
      background: var(--panel-2);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px;
    }

    .member-summary {
      font-size: 13px;
      color: var(--muted);
      margin-top: 8px;
    }

    .member-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .soft-box {
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
    }

    details {
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
    }

    details summary {
      cursor: pointer;
      color: var(--text);
      font-weight: bold;
      margin: 0;
    }

    details p {
      margin-top: 10px;
    }

    .link-button {
      display: inline-block;
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      color: var(--text);
      text-decoration: none;
      font-weight: bold;
    }

    .scenario-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    @media (max-width: 980px) {
      .grid {
        grid-template-columns: 1fr;
      }

      .metrics,
      .scenario-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 700px) {
      .wrap {
        padding: 12px;
      }

      .panel {
        padding: 14px;
        border-radius: 14px;
      }

      .metrics,
      .two-col,
      .three-col,
      .four-col,
      .scenario-grid {
        grid-template-columns: 1fr;
      }

      button {
        width: 100%;
      }

      th, td {
        padding: 8px;
        font-size: 13px;
      }

      table {
        min-width: 680px;
      }
    }