:root {
      --bg-main: #0e1117;
      --bg-panel: #161b22;
      --bg-input: #0d1117;
      --border: #30363d;
      --text-main: #c9d1d9;
      --text-muted: #8b949e;
      --accent: #58a6ff;
      --button-bg: #238636;
      --button-hover: #2ea043;
      --shadow: 0 20px 80px rgba(0,0,0,0.45);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      padding: 40px;
      background: var(--bg-main);
      font-family: "Segoe UI", Arial, sans-serif;
      color: var(--text-main);
    }

    .container {
      max-width: 1400px;
      margin: 0 auto;
    }

    .header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 18px;
    }

    h1 {
      margin: 0;
      font-size: 18px;
      font-weight: 650;
      color: var(--accent);
      letter-spacing: 0.2px;
    }

    .subtitle {
      margin: 0;
      font-size: 12px;
      color: var(--text-muted);
    }

    /* =========================
       BLOCKS GRID (cards)
       ========================= */
    .grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
      align-items: stretch;
      margin-top: 10px;
    }

    .tool-card {
      background: linear-gradient(180deg, rgba(22,27,34,1) 0%, rgba(14,17,23,0.6) 100%);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      cursor: pointer;
      transition: transform .12s ease, border-color .12s ease, background .12s ease;
      min-height: 150px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      outline: none;
    }

    .tool-card:hover {
      transform: translateY(-2px);
      border-color: rgba(88,166,255,0.45);
      background: linear-gradient(180deg, rgba(22,27,34,1) 0%, rgba(88,166,255,0.05) 100%);
    }

    .tool-card:focus-visible {
      box-shadow: 0 0 0 3px rgba(88,166,255,0.25);
    }

    .tool-card .title {
      font-size: 14px;
      font-weight: 750;
      color: var(--accent);
      margin: 0;
    }

    .tool-card .desc {
      font-size: 12px;
      color: var(--text-muted);
      margin: 0;
      line-height: 1.4;
      flex: 1;
    }

    .tool-card .meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 2px;
    }

    .pill {
      font-size: 11px;
      color: var(--text-main);
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.18);
      padding: 4px 8px;
      border-radius: 999px;
    }

    /* =========================
       SHARED UI (same as before)
       ========================= */
    .panel {
      background: var(--bg-panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 18px;
      min-height: 220px;
    }

    .panel-title {
      margin: 0 0 14px 0;
      font-size: 14px;
      font-weight: 650;
      color: var(--accent);
    }

    textarea, input {
      width: 100%;
      padding: 12px;
      background: var(--bg-input);
      color: var(--text-main);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-family: Consolas, monospace;
      font-size: 14px;
      outline: none;
    }

    textarea {
      height: 320px;
      resize: none;
    }

    textarea::placeholder, input::placeholder { color: var(--text-muted); }

    label {
      display: block;
      margin: 10px 0 6px;
      color: var(--text-muted);
      font-size: 12px;
    }

    .actions {
      margin-top: 12px;
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .btn {
      padding: 10px 16px;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
      color: #fff;
      background: var(--button-bg);
      font-weight: 600;
    }

    .btn:hover { background: var(--button-hover); }

    .btn-ghost {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-main);
    }

    .btn-ghost:hover { background: var(--bg-input); }

    .result {
      margin-top: 14px;
      padding: 14px;
      background: rgba(0,0,0,0.12);
      border: 1px solid var(--border);
      border-radius: 10px;
      position: relative;
    }

    pre {
      margin: 0;
      white-space: pre-wrap;
      font-family: Consolas, monospace;
      font-size: 13px;
      color: var(--text-main);
      line-height: 1.35;
    }

    .copy-small-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-muted);
      padding: 4px 8px;
      font-size: 12px;
      border-radius: 6px;
      cursor: pointer;
    }

    .copy-small-btn:hover {
      background: var(--bg-input);
      color: var(--text-main);
    }

    .hint {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.4;
      margin-top: 10px;
    }

    .footer {
      margin-top: 18px;
      font-size: 12px;
      color: var(--text-muted);
    }

    /* IOC links */
    .links h3 {
      margin: 0 0 10px 0;
      font-size: 13px;
      color: var(--text-main);
      font-weight: 650;
    }

    .links .section {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed rgba(48,54,61,0.9);
    }

    .links .section:first-child {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }

    .links .k {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 8px;
    }

    .links a {
      display: inline-block;
      margin: 4px 0;
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg-input);
      color: var(--accent);
      font-size: 13px;
      text-decoration: none;
    }

    .links a:hover { background: rgba(88,166,255,0.10); }

    code {
      font-family: Consolas, monospace;
      font-size: 12px;
      color: var(--text-main);
    }

    /* =========================
       MODAL SYSTEM
       ========================= */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.65);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 22px;
      z-index: 999;
    }

    .modal-overlay.open { display: flex; }

    .modal {
      width: min(980px, 100%);
      max-height: min(92vh, 980px);
      overflow: auto;
      background: var(--bg-panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: var(--shadow);
      position: relative;
      padding: 18px;
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(48,54,61,0.6);
      margin-bottom: 14px;
    }

    .modal-title {
      margin: 0;
      font-size: 14px;
      font-weight: 750;
      color: var(--accent);
    }

    .modal-subtitle {
      margin: 4px 0 0 0;
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.35;
    }

    .modal-close {
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-main);
      border-radius: 10px;
      padding: 8px 10px;
      cursor: pointer;
      font-weight: 650;
    }

    .modal-close:hover { background: var(--bg-input); }

    /* let modal content reuse panel spacing nicely */
    .modal .panel {
      border-radius: 12px;
      min-height: auto;
    }

    .result-title{
      font-size: 12px;
      font-weight: 750;
      color: var(--accent);
      margin-bottom: 10px;
    }


    @media (max-width: 1200px) {
      body { padding: 20px; }
      .grid { grid-template-columns: 1fr; }
      textarea { height: 260px; }
    }
