.tw-rg-app{max-width:1200px;margin:0 auto;padding-top:20px;font-family:inherit;color:#1a1a2e}
.tw-rg-app *,.tw-rg-app *::before,.tw-rg-app *::after{box-sizing:border-box}

/* Mode switcher */
.tw-rg-mode-switch{display:flex;gap:0;margin-bottom:14px;border:1.5px solid #56aea4;border-radius:20px;overflow:hidden;width:fit-content}
.tw-rg-mode-btn{padding:8px 24px;font-size:13px;font-weight:600;border:none;cursor:pointer;font-family:inherit;transition:all .15s;background:#fff;color:#56aea4}
.tw-rg-mode-btn.tw-rg-mode-active{background:#56aea4;color:#fff}
.tw-rg-mode-btn:hover:not(.tw-rg-mode-active){background:#f0fdf8}

.tw-rg-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:10px;flex-wrap:wrap}
.tw-rg-panel-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#6b7280}
.tw-rg-header-actions{display:flex;gap:6px}
.tw-rg-btn-action{display:inline-flex;align-items:center;gap:5px;padding:6px 12px;font-size:12px;font-weight:500;color:#6b7280;background:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;transition:all .15s;font-family:inherit;line-height:1}
.tw-rg-btn-action:hover{background:#f3f4f6;color:#1a1a2e;border-color:#d1d5db}

.tw-rg-main{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}

.tw-rg-config{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:14px}
.tw-rg-section{}
.tw-rg-section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.tw-rg-label{font-size:12px;font-weight:600;color:#1a1a2e;display:block;margin-bottom:6px}
.tw-rg-section-header .tw-rg-label{margin-bottom:0}
.tw-rg-input{width:100%;height:38px;padding:0 12px;border:1px solid #e5e7eb;border-radius:8px;font-size:13px;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}
.tw-rg-input:focus{border-color:#56aea4;box-shadow:0 0 0 3px rgba(86,174,164,.1)}

.tw-rg-btn-add{padding:6px 14px;font-size:12px;font-weight:600;color:#56aea4;background:#fff;border:1.5px solid #56aea4;border-radius:20px;cursor:pointer;transition:all .15s;font-family:inherit;white-space:nowrap}
.tw-rg-btn-add:hover{background:#56aea4;color:#fff}

.tw-rg-rules{display:flex;flex-direction:column;gap:12px}
.tw-rg-rule-group{background:#f8f9fa;border:1px solid #e5e7eb;border-radius:8px;padding:12px}
.tw-rg-rule-group-header{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.tw-rg-rule-group-header .tw-rg-input{flex:1}
.tw-rg-btn-remove{width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;color:#dc2626;transition:all .15s;flex-shrink:0}
.tw-rg-btn-remove:hover{background:#fef2f2;border-color:#fecaca}

.tw-rg-directives{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.tw-rg-directive-row{display:flex;gap:6px;align-items:center}
.tw-rg-directive-row select{width:120px;height:34px;padding:0 8px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px;font-family:inherit;color:#1a1a2e;background:#fff;cursor:pointer}
.tw-rg-directive-row .tw-rg-input{height:34px;flex:1}
.tw-rg-btn-add-dir{padding:4px 12px;font-size:11px;font-weight:600;color:#56aea4;background:transparent;border:1px dashed #56aea4;border-radius:6px;cursor:pointer;transition:all .15s;font-family:inherit}
.tw-rg-btn-add-dir:hover{background:#f0fdf8}

.tw-rg-preview-panel{background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;display:flex;flex-direction:column}
.tw-rg-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #f3f4f6;background:#f8f9fa}
.tw-rg-btn-copy{padding:5px 14px;font-size:12px;font-weight:600;color:#56aea4;background:#fff;border:1.5px solid #56aea4;border-radius:20px;cursor:pointer;transition:all .15s;font-family:inherit}
.tw-rg-btn-copy:hover{background:#56aea4;color:#fff}
.tw-rg-output{flex:1;width:100%;min-height:300px;border:none;outline:none;padding:14px;font-size:13px;line-height:1.6;resize:none;font-family:'Courier New',monospace;color:#1a1a2e;background:#f8fffe}

.tw-rg-article-toggle{margin-bottom:12px}
.tw-rg-toggle-btn{display:flex;align-items:center;gap:8px;width:100%;padding:12px 16px;background:#fff;border:1.5px solid #56aea4;border-radius:10px;cursor:pointer;font-size:14px;font-weight:600;color:#56aea4;font-family:inherit;transition:all .15s;text-align:left}
.tw-rg-toggle-btn:hover{background:#f0fdf8;border-color:#4a9e94;color:#4a9e94}
.tw-rg-toggle-chevron{transition:transform .25s ease;flex-shrink:0;color:#56aea4}
.tw-rg-toggle-btn.tw-rg-toggle-open .tw-rg-toggle-chevron{transform:rotate(180deg)}
.tw-rg-h1{font-size:14px;font-weight:600;margin:0;padding:0;color:inherit;font-family:inherit;line-height:1.4}

/* User-Agent select dropdown */
.tw-rg-ua-select{flex:1;height:38px;padding:0 12px;border:1px solid #e5e7eb;border-radius:8px;font-size:13px;color:#1a1a2e;background:#fff;cursor:pointer;font-family:inherit;outline:none;transition:border-color .2s;appearance:auto}
.tw-rg-ua-select:focus{border-color:#56aea4;box-shadow:0 0 0 3px rgba(86,174,164,.1)}
.tw-rg-custom-ua-row{display:flex;margin:-4px 0 8px 0;padding-right:38px}
.tw-rg-custom-ua-row .tw-rg-input{border-color:#56aea4;background:#f0fdf8}

/* ─── Analyze mode ─── */
.tw-rg-analyze-input-row{display:flex;gap:10px;margin-bottom:16px}
.tw-rg-analyze-url-input{flex:1}
.tw-rg-btn-primary{padding:8px 24px;font-size:13px;font-weight:600;color:#fff;background:#56aea4;border:none;border-radius:8px;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap}
.tw-rg-btn-primary:hover{background:#4a9e94}
.tw-rg-btn-primary:disabled{opacity:.5;cursor:not-allowed}

/* Score */
.tw-rg-score-row{display:flex;align-items:center;gap:16px;margin-bottom:16px;padding:16px;background:#fff;border:1px solid #e5e7eb;border-radius:10px}
.tw-rg-score-badge{display:flex;align-items:baseline;gap:4px;border:3px solid #22c55e;border-radius:50%;width:80px;height:80px;justify-content:center;align-items:center;flex-shrink:0}
.tw-rg-score-value{font-size:28px;font-weight:800;color:#22c55e}
.tw-rg-score-label{font-size:12px;color:#6b7280;font-weight:500}
.tw-rg-score-url{font-size:13px;color:#6b7280;word-break:break-all}

/* Stats grid */
.tw-rg-stats-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:16px}
.tw-rg-stat-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:12px 10px;text-align:center}
.tw-rg-stat-num{font-size:20px;font-weight:700;color:#1a1a2e;margin-bottom:2px}
.tw-rg-stat-label{font-size:11px;color:#6b7280;font-weight:500;text-transform:uppercase;letter-spacing:.04em}

/* Section blocks */
.tw-rg-section-block{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:16px;margin-bottom:14px}
.tw-rg-section-title{font-size:13px;font-weight:700;color:#1a1a2e;margin-bottom:10px;text-transform:uppercase;letter-spacing:.04em}
.tw-rg-section-title-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.tw-rg-section-title-row .tw-rg-section-title{margin-bottom:0}

/* Issues */
.tw-rg-issues-list{display:flex;flex-direction:column;gap:8px}
.tw-rg-issue-item{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-radius:8px;font-size:13px;line-height:1.5}
.tw-rg-issue-error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.tw-rg-issue-warning{background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.tw-rg-issue-info{background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af}
.tw-rg-sev-icon{flex-shrink:0;font-size:15px;line-height:1.3}
.tw-rg-sev-error{color:#dc2626}
.tw-rg-sev-warning{color:#f59e0b}
.tw-rg-sev-info{color:#3b82f6}

/* AI Bots grid */
.tw-rg-ai-bots-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
.tw-rg-ai-bot-item{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;font-size:13px;font-weight:500;border:1px solid #e5e7eb}
.tw-rg-ai-blocked{background:#fef2f2;border-color:#fecaca}
.tw-rg-ai-allowed{background:#f0fdf4;border-color:#bbf7d0}
.tw-rg-ai-status{font-size:15px;flex-shrink:0}
.tw-rg-ai-blocked .tw-rg-ai-status{color:#dc2626}
.tw-rg-ai-allowed .tw-rg-ai-status{color:#22c55e}
.tw-rg-ai-name{color:#1a1a2e}

/* User-Agent blocks (expandable) */
.tw-rg-block-details{border:1px solid #e5e7eb;border-radius:8px;overflow:hidden;margin-bottom:8px}
.tw-rg-block-details:last-child{margin-bottom:0}
.tw-rg-block-summary{padding:10px 14px;cursor:pointer;font-size:13px;background:#f8f9fa;display:flex;align-items:center;justify-content:space-between;list-style:none}
.tw-rg-block-summary::-webkit-details-marker{display:none}
.tw-rg-block-summary::marker{display:none;content:''}
.tw-rg-block-count{font-size:11px;color:#6b7280;font-weight:400;background:#e5e7eb;padding:2px 8px;border-radius:10px}
.tw-rg-block-rules{padding:10px 14px;background:#fff}
.tw-rg-block-rule{padding:3px 0;font-size:12px;font-family:'Courier New',monospace}

/* Raw content */
.tw-rg-raw-content{background:#f8fffe;border:1px solid #e5e7eb;border-radius:8px;padding:14px;font-size:12px;line-height:1.7;font-family:'Courier New',monospace;overflow-x:auto;max-height:400px;overflow-y:auto;margin:0;white-space:pre-wrap;word-break:break-word}

/* Syntax highlighting */
.tw-rg-hl-ua{color:#2563eb;font-weight:600}
.tw-rg-hl-disallow{color:#dc2626}
.tw-rg-hl-allow{color:#16a34a}
.tw-rg-hl-sitemap{color:#7c3aed}
.tw-rg-hl-comment{color:#9ca3af;font-style:italic}
.tw-rg-hl-crawldelay{color:#f59e0b}

/* Sitemaps */
.tw-rg-sitemaps-list{display:flex;flex-direction:column;gap:6px}
.tw-rg-sitemap-link{color:#2563eb;font-size:13px;text-decoration:none;word-break:break-all}
.tw-rg-sitemap-link:hover{text-decoration:underline}

@media(max-width:880px){
  .tw-rg-main{grid-template-columns:1fr}
  .tw-rg-stats-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:500px){
  .tw-rg-header{flex-direction:column;align-items:stretch}
  .tw-rg-directive-row{flex-wrap:wrap}
  .tw-rg-directive-row select{width:100%}
  .tw-rg-stats-grid{grid-template-columns:repeat(2,1fr)}
  .tw-rg-analyze-input-row{flex-direction:column}
  .tw-rg-score-row{flex-direction:column;align-items:center;text-align:center}
}
