#textpur-app {
  --tp-accent:      #cc0000;
  --tp-accent-dark: #aa0000;
  --tp-text:        #111111;
  --tp-bg:          #ffffff;
  --tp-green:       #1a8a4a;
  --tp-warn:        #e67e00;
  --tp-surface:     #f7f7f7;
  --tp-surface2:    #eeeeee;
  --tp-border:      #e0e0e0;
  --tp-muted:       #666666;
  --tp-dim:         #aaaaaa;
  --tp-font:        'Inter', -apple-system, sans-serif;
  --tp-radius:      12px;
  --tp-radius-sm:   8px;
  background: var(--tp-bg);
  color: var(--tp-text);
  font-family: var(--tp-font);
  font-size: 15px;
  line-height: 1.65;
  padding: 40px 0 80px;
  max-width: 860px;
  margin: 0 auto;
}
.tp-header { text-align:center; padding:20px 20px 36px; }
.tp-badge { display:inline-flex; align-items:center; gap:7px; background:#fff0f0; border:1.5px solid #ffcccc; border-radius:100px; padding:5px 16px; font-size:12px; font-weight:600; color:var(--tp-accent); letter-spacing:.04em; text-transform:uppercase; margin-bottom:20px; }
.tp-dot { width:7px; height:7px; background:var(--tp-accent); border-radius:50%; display:inline-block; animation:tp-pulse 2s infinite; }
@keyframes tp-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }
.tp-title { font-size:clamp(28px,5vw,44px); font-weight:900; letter-spacing:-.02em; color:var(--tp-text); margin:0 0 14px; line-height:1.1; font-family:var(--tp-font); }
.tp-title em { font-style:normal; color:var(--tp-accent); }
.tp-subtitle { color:var(--tp-muted); font-size:16px; max-width:520px; margin:0 auto; }

.tp-stats-bar { display:flex; border:1.5px solid var(--tp-border); border-radius:var(--tp-radius); overflow:hidden; margin:0 20px 28px; }
.tp-stat { flex:1; background:var(--tp-bg); padding:16px 12px; text-align:center; border-right:1px solid var(--tp-border); }
.tp-stat:last-child { border-right:none; }
.tp-stat-val { font-size:22px; font-weight:800; color:var(--tp-accent); display:block; line-height:1; margin-bottom:5px; font-family:var(--tp-font); }
.tp-col-danger { color:var(--tp-accent) !important; }
.tp-stat-lbl { font-size:10px; color:var(--tp-muted); text-transform:uppercase; letter-spacing:.06em; font-weight:600; }

.tp-card { background:var(--tp-bg); border:1.5px solid var(--tp-border); border-radius:var(--tp-radius); overflow:hidden; margin:0 20px 12px; }
.tp-card-header { display:flex; align-items:center; justify-content:space-between; padding:11px 16px; border-bottom:1px solid var(--tp-border); background:var(--tp-surface); }
.tp-card-title { font-size:11px; font-weight:700; color:var(--tp-muted); text-transform:uppercase; letter-spacing:.08em; }
.tp-char-count { font-size:11px; color:var(--tp-dim); font-weight:500; }
.tp-card textarea { width:100%; background:var(--tp-bg); border:none; outline:none; color:var(--tp-text); font-family:var(--tp-font); font-size:15px; line-height:1.7; padding:16px; resize:none; min-height:200px; display:block; }
.tp-card textarea::placeholder { color:var(--tp-dim); }
.tp-card-output textarea { color:var(--tp-green); font-weight:500; }

.tp-actions { display:flex; gap:10px; flex-wrap:wrap; margin:0 20px 12px; }
.tp-actions-bottom { margin-top:4px; }
.tp-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 20px; border-radius:var(--tp-radius-sm); font-family:var(--tp-font); font-size:14px; font-weight:700; cursor:pointer; border:none; transition:all .15s; white-space:nowrap; }
.tp-btn-primary { background:var(--tp-accent); color:#fff; flex:1; min-width:160px; font-size:15px; padding:14px 24px; box-shadow:0 2px 8px rgba(0,0,0,.15); }
.tp-btn-primary:hover { filter:brightness(0.9); transform:translateY(-1px); box-shadow:0 4px 16px rgba(0,0,0,.2); }
.tp-btn-secondary { background:var(--tp-bg); color:var(--tp-text); border:1.5px solid var(--tp-border); font-weight:600; }
.tp-btn-secondary:hover { border-color:var(--tp-accent); color:var(--tp-accent); }
.tp-btn-ghost { background:transparent; color:var(--tp-muted); border:1.5px solid var(--tp-border); font-weight:600; }
.tp-btn-ghost:hover { color:var(--tp-text); border-color:#bbb; }
.tp-btn-sm { padding:5px 12px; font-size:12px; }
.tp-btn-copy { flex:1; }
.tp-btn-copy.success { background:#f0faf4; color:var(--tp-green); border-color:#a8dbbe; }

.tp-panel { display:none; background:var(--tp-bg); border:1.5px solid var(--tp-border); border-radius:var(--tp-radius); margin:0 20px 12px; overflow:hidden; }
.tp-panel.open { display:block; }
.tp-panel-header { display:flex; align-items:center; justify-content:space-between; padding:11px 16px; border-bottom:1px solid var(--tp-border); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.tp-warn-header   { background:#fff8ec; color:var(--tp-warn); }
.tp-danger-header { background:#fff0f0; color:var(--tp-accent); }

.tp-viz-content { padding:16px; font-family:monospace; font-size:13px; line-height:2.4; word-break:break-all; }
.tp-viz-char { display:inline-flex; align-items:center; justify-content:center; min-width:26px; height:26px; margin:2px; border-radius:4px; border:1px solid var(--tp-border); color:var(--tp-muted); font-size:12px; background:var(--tp-surface); cursor:default; transition:all .15s; }
.tp-viz-char:hover { transform:scale(1.15); position:relative; z-index:2; }
.tp-viz-char.suspicious { background:#fff0f0; border-color:#ffaaaa; color:var(--tp-accent); font-weight:700; }

.tp-score-section { padding:16px 18px; border-bottom:1px solid var(--tp-border); }
.tp-score-label { display:flex; justify-content:space-between; margin-bottom:10px; font-size:13px; color:var(--tp-muted); font-weight:500; }
.tp-score-val { font-weight:800; font-size:15px; color:var(--tp-text); }
.tp-score-val.safe  { color:var(--tp-green); }
.tp-score-val.risky { color:var(--tp-accent); }
.tp-score-bar { background:var(--tp-surface2); border-radius:100px; height:7px; overflow:hidden; }
.tp-score-fill { height:100%; border-radius:100px; transition:width .8s cubic-bezier(.4,0,.2,1); background:var(--tp-green); }
.tp-score-fill.risky { background:var(--tp-accent); }
.tp-analysis-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); border-bottom:1px solid var(--tp-border); }
.tp-analysis-item { padding:14px 18px; border-right:1px solid var(--tp-border); border-bottom:1px solid var(--tp-border); }
.tp-analysis-item-label { font-size:10px; font-weight:700; color:var(--tp-muted); text-transform:uppercase; letter-spacing:.07em; margin-bottom:5px; }
.tp-analysis-item-val { font-size:20px; font-weight:800; color:var(--tp-text); }
.tp-analysis-item-val.alert { color:var(--tp-accent); }
.tp-analysis-item-val.ok    { color:var(--tp-green); }
.tp-susp-list { padding:14px 18px; }
.tp-susp-list h4 { font-size:10px; font-weight:700; color:var(--tp-muted); text-transform:uppercase; letter-spacing:.07em; margin-bottom:10px; }
.tp-susp-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--tp-border); font-size:13px; }
.tp-susp-row:last-child { border-bottom:none; }
.tp-susp-code { font-family:monospace; background:#fff0f0; color:var(--tp-accent); border-radius:4px; padding:2px 8px; font-size:11px; font-weight:700; min-width:80px; text-align:center; }
.tp-susp-desc  { color:var(--tp-muted); flex:1; }
.tp-susp-count { font-weight:700; color:var(--tp-warn); font-size:12px; }

.tp-divider { text-align:center; padding:8px 0; color:var(--tp-dim); font-size:18px; letter-spacing:4px; }

.tp-save-status { font-size:12px; color:var(--tp-muted); text-align:right; margin:0 20px 4px; min-height:18px; font-weight:500; }
.tp-save-status.ok  { color:var(--tp-green); }
.tp-save-status.err { color:var(--tp-accent); }

.tp-faq { margin:52px 20px 0; }
.tp-faq-heading { font-size:26px; font-weight:900; color:var(--tp-text); margin-bottom:6px; font-family:var(--tp-font); }
.tp-faq-sub { color:var(--tp-muted); font-size:15px; margin-bottom:24px; }
.tp-faq-item { border-bottom:1.5px solid var(--tp-border); }
.tp-faq-q { display:flex; align-items:center; justify-content:space-between; padding:18px 0; cursor:pointer; font-size:15px; font-weight:700; color:var(--tp-text); gap:16px; user-select:none; transition:color .15s; font-family:var(--tp-font); }
.tp-faq-q:hover { color:var(--tp-accent); }
.tp-faq-icon { width:26px; height:26px; border-radius:50%; border:2px solid var(--tp-border); display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:16px; font-weight:700; color:var(--tp-muted); transition:all .2s; }
.tp-faq-item.open .tp-faq-icon { border-color:var(--tp-accent); color:var(--tp-accent); transform:rotate(45deg); }
.tp-faq-a { max-height:0; overflow:hidden; transition:max-height .35s ease,padding .2s; color:var(--tp-muted); font-size:14px; line-height:1.75; }
.tp-faq-item.open .tp-faq-a { max-height:300px; padding-bottom:18px; }

.tp-toast { position:fixed; bottom:28px; left:50%; transform:translateX(-50%) translateY(80px); background:#111; border-radius:100px; padding:12px 24px; font-size:14px; font-weight:600; color:#fff; display:flex; align-items:center; gap:10px; z-index:9999; transition:transform .3s cubic-bezier(.4,0,.2,1); box-shadow:0 8px 32px rgba(0,0,0,.2); white-space:nowrap; }
.tp-toast.show { transform:translateX(-50%) translateY(0); }

@media (max-width:600px) {
  .tp-stats-bar { flex-direction:column; }
  .tp-stat { border-right:none; border-bottom:1px solid var(--tp-border); }
  .tp-stat:last-child { border-bottom:none; }
  .tp-actions { flex-direction:column; }
  .tp-btn-primary { min-width:unset; }
}
