/* =========================================================
   TEXTAREAS
========================================================= */

#negative-thought,
#balanced-thought {
    display:block;
    width:100%;
    min-height:165px;
    box-sizing:border-box;
    padding:16px 18px;
    margin:0 0 8px;
    resize:vertical;
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    background:#0d1012;
    color:#e3e7e6;
    caret-color:#34d399;
    font:inherit;
    font-size:1rem;
    line-height:1.6;
    outline:none;
    appearance:none;
    -webkit-appearance:none;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 8px 24px rgba(0,0,0,.18);
    transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}

#negative-thought::placeholder,
#balanced-thought::placeholder { color:#596260; opacity:1; }

#negative-thought:focus,
#balanced-thought:focus {
    border-color:rgba(52,211,153,.55);
    background:#111517;
    box-shadow:0 0 0 2px rgba(52,211,153,.08),inset 0 1px 0 rgba(255,255,255,.03);
}

#balanced-thought { min-height:165px; }

/* =========================================================
   STEP 2 — DISTORTION CARDS
========================================================= */

.distortions-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; width:100%; max-width:820px; margin:24px auto 25px; }

.distortion-card { width:100%; box-sizing:border-box; display:block; cursor:pointer; text-align:left; padding:20px 22px; }

.distortion-card .distortion-title { display:block; margin:0 0 10px; font-size:1.05rem; line-height:1.35; font-weight:800; }

.distortion-card .distortion-description { display:block; margin:0 0 12px; font-size:.92rem; line-height:1.55; }

.distortion-card .distortion-example { display:block; margin:0; padding-top:11px; border-top:1px solid rgba(255,255,255,.08); font-size:.87rem; line-height:1.5; opacity:.82; }

.distortion-card.selected { border-color:rgba(52,211,153,.55); background:linear-gradient(135deg,rgba(52,211,153,.12),rgba(167,139,250,.06)); }

.distortion-card.selected .distortion-title { color:#34d399; }

@media (max-width:620px) {
    .distortions-grid { grid-template-columns:1fr; max-width:100%; }
    .distortion-card { padding:18px; }
    .step4-summary { padding:16px; }
    .step4-thought { padding:20px 16px; }
}


 /* =========================================================
    STEP 3 — REFRAME
 ========================================================= */

.step3-box { width:100%; box-sizing:border-box; margin-bottom:20px; }

.step3-original { border-left:4px solid #a78bfa; background:linear-gradient(135deg,rgba(167,139,250,.14),rgba(167,139,250,.045)); }

.step3-box .instruction { margin:0 0 12px; }

.step3-box .box-text { margin:0; line-height:1.65; overflow-wrap:anywhere; }

.step3-patterns { width:100%; margin:0 0 22px; }

.step3-label { margin:0 0 8px; }

.step3-tips { width:100%; box-sizing:border-box; margin:0 0 24px; padding:20px 22px; border:1px solid rgba(167,139,250,.22); border-radius:16px; background:linear-gradient(135deg,rgba(52,211,153,.07),rgba(167,139,250,.09)); }

.step3-tips-title { margin:0 0 14px; font-size:1rem; font-weight:800; color:var(--text); }

.step3-tips .tip-list { margin:0; padding-left:20px; }

.step3-tips .tip-list li { margin-bottom:8px; line-height:1.5; }

.step3-tips .tip-list li:last-child { margin-bottom:0; }

#balanced-thought { width:100%; box-sizing:border-box; min-height:165px; resize:vertical; margin-bottom:8px; }


/* =========================================================
   STEP 4 — THOUGHT REFRAME
========================================================= */

/* =========================================================
   STEP 4 — THOUGHT REFRAME
========================================================= */

.step4-thought { width:100%; box-sizing:border-box; margin:0 0 20px; padding:22px 24px; display:block; }

.step4-original { border-left:4px solid #a78bfa; background:linear-gradient(135deg,rgba(167,139,250,.14),rgba(167,139,250,.045)); }

.step4-balanced { border-left:4px solid #34d399; background:linear-gradient(135deg,rgba(52,211,153,.14),rgba(52,211,153,.045)); }

.step4-thought .instruction { display:block; width:100%; margin:0 0 10px; padding:0; font-weight:800; }

.step4-thought .box-text { display:block; width:100%; max-width:none; margin:0; padding:0; line-height:1.65; overflow-wrap:anywhere; word-break:normal; }

.step4-divider { margin:24px 0; text-align:center; font-size:.8rem; font-weight:800; letter-spacing:.28em; color:#a78bfa; }

.step4-patterns { width:100%; margin:4px 0 24px; padding:0; }

.step4-label { display:block; width:100%; margin:0 0 8px; padding:0; }

.practice-note { width:100%; box-sizing:border-box; display:block; margin:0 0 25px; padding:22px 24px; border:1px solid rgba(167,139,250,.30); background:linear-gradient(135deg,rgba(167,139,250,.08),rgba(52,211,153,.07)); }

.practice-note .instruction { display:block; width:100%; margin:0 0 10px; padding:0; font-weight:800; }

.practice-note .box-text { display:block; width:100%; max-width:none; margin:0; padding:0; line-height:1.65; }

@media (max-width:620px) {
    .step4-thought,
    .practice-note { padding:20px 18px; }
}


/* =========================================================
   TAGS
========================================================= */

.tag-container { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }

.tag { display:inline-flex; align-items:center; border:1px solid rgba(52,211,153,.4); border-radius:999px; background:rgba(52,211,153,.09); color:#d9fff0; padding:5px 14px; font-size:.875rem; font-weight:600; }

.tag-empty { font-size:.9rem; color:#7c9a92; font-style:italic; }


/* =========================================================
   PRACTICE NOTE
========================================================= */

.practice-note { width:100%; box-sizing:border-box; margin-bottom:25px; border:1px solid rgba(167,139,250,.34); background:linear-gradient(90deg,rgba(52,211,153,.11),rgba(167,139,250,.22)); }

.practice-note .instruction { margin:0 0 8px; }

.practice-note .box-text { margin:0; line-height:1.65; }


/* =========================================================
   INLINE VALIDATION
========================================================= */

.validation-message { margin:8px 0 14px; color:#f0a7a7; font-size:.88rem; text-align:left; }


/* =========================================================
   NEXT TOOL
========================================================= */

#next-tool { display:none; width:100%; max-width:700px; margin:28px auto 0; padding:0; background:transparent; border:0; box-shadow:none; text-align:center; }

#next-tool p { margin:0 0 14px; padding:0; color:var(--text); font-size:1rem; line-height:1.5; }

#next-tool p strong { color:var(--text); font-weight:800; }

#next-tool .tool-btn { display:inline-block; width:auto; margin:0 auto; text-decoration:none; }


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width:620px) {
    .distortions-grid { grid-template-columns:1fr; }
    .step4-summary { padding:16px; }
    .step4-thought { padding:20px 16px; }
}