:root {
      --bg: #1e1f22;
      --panel: #25272d;
      --panel-alt: #2b2f36;
      --input: #17181c;
      --fg: #f2f2f3;
      --muted: #b9bcc4;
      --accent: #4f8cff;
      --accent-hover: #6ca0ff;
      --border: #3a3f4b;
      --success: #6dd37c;
      --warning: #ffcc66;
      --danger: #ff7373;
      --shadow: rgba(0,0,0,.25);
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--fg);
      font-family: "Pretendard", "맑은 고딕", "Malgun Gothic", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      line-height: 1.5;
    }

    .app {
      width: min(1600px, 100%);
      margin: 0 auto;
      padding: 18px;
    }

    .topbar {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 12px;
      box-shadow: 0 12px 30px var(--shadow);
      position: sticky;
      top: 0;
      z-index: 20;
    }

    h1 {
      font-size: 20px;
      margin: 0 12px 0 0;
      letter-spacing: -0.02em;
      white-space: nowrap;
    }

    button {
      appearance: none;
      border: 1px solid var(--border);
      background: var(--panel-alt);
      color: var(--fg);
      border-radius: 12px;
      padding: 9px 13px;
      font-size: 14px;
      cursor: pointer;
      transition: .15s ease;
      white-space: nowrap;
    }

    button:hover { background: #333844; }
    button:active { transform: translateY(1px); }
    button.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
      font-weight: 700;
    }
    button.primary:hover { background: var(--accent-hover); }

    .hint {
      color: var(--muted);
      font-size: 13px;
      margin-left: auto;
    }

    .status {
      margin: 10px 2px 12px;
      color: var(--muted);
      font-size: 13px;
      min-height: 20px;
    }

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

    .card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 18px;
      box-shadow: 0 12px 30px var(--shadow);
      overflow: hidden;
    }

    .card-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      background: var(--panel-alt);
      border-bottom: 1px solid var(--border);
      font-weight: 700;
    }

    .table-wrap {
      overflow: auto;
      max-height: 58vh;
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      min-width: 980px;
    }

    th, td {
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      padding: 6px;
      text-align: center;
      vertical-align: middle;
      background: var(--bg);
    }

    th {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--panel-alt);
      color: var(--fg);
      font-weight: 700;
      padding: 9px 6px;
    }

    th:first-child, td:first-child {
      position: sticky;
      left: 0;
      z-index: 8;
      background: var(--panel-alt);
      text-align: left;
      min-width: 136px;
      font-weight: 700;
    }

    th:first-child { z-index: 12; }

    tr.meta-row td:first-child { color: var(--muted); }
    tr.class-row td:first-child { color: var(--fg); }

    input[type="text"], input[type="number"] {
      width: 100%;
      min-width: 86px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--input);
      color: var(--fg);
      padding: 8px 9px;
      font-size: 14px;
      outline: none;
    }

    input[type="text"]:focus, input[type="number"]:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(79,140,255,.14);
    }

    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
      cursor: pointer;
    }

    .result {
      padding: 0;
    }

    .result pre {
      margin: 0;
      min-height: 260px;
      max-height: 45vh;
      overflow: auto;
      background: var(--input);
      color: var(--fg);
      padding: 14px;
      white-space: pre-wrap;
      word-break: keep-all;
      font-family: "D2Coding", "Consolas", "맑은 고딕", monospace;
      font-size: 14px;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      border: 1px solid var(--border);
      background: var(--bg);
      border-radius: 999px;
      padding: 4px 9px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
    }

    .small-note {
      color: var(--muted);
      font-size: 12px;
      font-weight: 500;
    }

    .toast {
      position: fixed;
      right: 18px;
      bottom: 18px;
      background: var(--panel-alt);
      color: var(--fg);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px 14px;
      box-shadow: 0 14px 34px rgba(0,0,0,.35);
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
      transition: .2s ease;
      z-index: 50;
      max-width: min(420px, calc(100vw - 36px));
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    @media (max-width: 720px) {
      .app { padding: 10px; }
      .topbar { border-radius: 14px; }
      h1 { width: 100%; }
      .hint { margin-left: 0; width: 100%; }
      .table-wrap { max-height: 55vh; }
      .result pre { max-height: 42vh; }
    }
