/* ═══════════════════════════════════════════════════════
   TEXT REPEATER TOOL – Refined Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ─── VARIABLES ────────────────────────────────────────── */
:root {
    --tr-bg: var(--surface-2);
    --tr-card-bg: var(--surface);
    --tr-card-border: rgba(68, 97, 242, .07);
    --tr-card-shadow: 0 1px 4px rgba(68, 97, 242, .06), 0 4px 24px rgba(0, 0, 0, .04);
    --tr-text-main: var(--ink);
    --tr-text-muted: var(--ink-3);
    --tr-text-sub: var(--ink-2);
    --tr-surface-2: var(--surface-2);
    --tr-surface-3: var(--surface-3);
    --tr-divider: var(--surface-3);
    --tr-toolbar-border: rgba(68, 97, 242, .07);
    --tr-btn-bg: var(--surface-3);
    --tr-primary: #6366f1;
    --tr-primary-hover: #4f46e5;
    --tr-primary-light: rgba(99, 102, 241, .1);
    --tr-green: #10b981;
    --tr-rose: #f43f5e;
    --tr-rose-bg: rgba(244, 63, 94, .08);
    --tr-radius: 14px;
    --tr-radius-sm: 8px;
    --tr-transition: .22s ease;
}

[data-theme="dark"] {
    --tr-bg: #111318;
    --tr-card-bg: #1a1d24;
    --tr-card-border: #252836;
    --tr-card-shadow: 0 4px 28px rgba(0, 0, 0, .35);
    --tr-text-main: #f1f5f9;
    --tr-text-muted: #64748b;
    --tr-text-sub: #94a3b8;
    --tr-surface-2: #141720;
    --tr-surface-3: #1e2130;
    --tr-divider: #252836;
    --tr-toolbar-border: #252836;
    --tr-btn-bg: #1e2130;
    --tr-primary-light: rgba(99, 102, 241, .18);
}

/* ─── PAGE WRAPPER ─────────────────────────────────────── */
.tr-page-wrapper {
    background: var(--tr-bg);
    /* min-height: calc(100vh - 80px);   */
    padding: 100px 0px 0px 0px;
    transition: background .3s ease;
}

.ic-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 36px;
}

.ic-header h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4.5vw, 46px);
    font-weight: 800;
    color: var(--ic-text-main);
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-bottom: 14px;
}

.ic-header h1 span {
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── WORKSPACE GRID ───────────────────────────────────── */
.tr-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ─── SHARED CARD ──────────────────────────────────────── */
.tr-card {
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-card-border);
    border-radius: 16px;
    box-shadow: var(--tr-card-shadow);
    transition: background .3s, border-color .3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tool-card {
    background: white !important;
}

/* ─── CARD HEADER ──────────────────────────────────────── */
.tr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--tr-toolbar-border);
    flex-wrap: wrap;
}

.tr-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tr-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--tr-primary-light);
    color: var(--tr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tr-card-icon--purple {
    background: rgba(124, 58, 237, .1);
    color: #7c3aed;
}

[data-theme="dark"] .tr-card-icon--purple {
    background: rgba(124, 58, 237, .2);
}

.tr-header-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tr-text-main);
    margin: 0 0 2px;
    line-height: 1.2;
}

.tr-header-text p {
    font-size: 12.5px;
    color: var(--tr-text-muted);
    margin: 0;
    line-height: 1.2;
}

.tr-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── BUTTONS ──────────────────────────────────────────── */
.tr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--tr-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--tr-text-sub);
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-card-border);
    cursor: pointer;
    transition: all var(--tr-transition);
}

.tr-action-btn:hover {
    background: var(--tr-surface-3);
    color: var(--tr-text-main);
    border-color: rgba(99, 102, 241, .25);
    transform: translateY(-1px);
}

.tr-action-btn--primary {
    background: var(--tr-primary) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.tr-action-btn--primary:hover {
    background: var(--tr-primary-hover) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}

.tr-action-btn--clear {
    color: var(--tr-text-sub);
    border-color: var(--tr-card-border);
}

.tr-action-btn--clear:hover {
    color: var(--tr-rose);
    background: var(--tr-rose-bg);
    border-color: rgba(244, 63, 94, .2);
}

/* ─── CARD BODY ────────────────────────────────────────── */
.tr-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-card-body .tr-section.textarea-section {
    position: relative;
}

/* ─── SECTIONS ─────────────────────────────────────────── */
.tr-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-repetition-count-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.tr-repetition-count-section .tr-section {
    padding: 5px 10px;
    border: 1.5px solid rgb(0 0 0 / 18%);
    border-radius: 10px;
}

[data-theme="dark"] .tr-repetition-count-section .tr-section {
    border-color: var(--tr-card-border);
}

.tr-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tr-text-muted);
}

/* ─── INPUT TEXT AREA ──────────────────────────────────── */
.tr-textarea-wrap {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tr-card-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--tr-card-bg);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .02);
    transition: border-color var(--tr-transition);
}

.tr-textarea-wrap:focus-within {
    border-color: rgba(99, 102, 241, .35);
}

.tr-textarea-wrap textarea {
    width: 100%;
    min-height: 130px;
    padding: 16px;
    border: none;
    background: transparent;
    color: var(--tr-text-main);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.tr-textarea-wrap textarea::placeholder {
    color: var(--tr-text-muted);
}

.tr-input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--tr-text-muted);
    background: var(--tr-surface-2);
    border-top: 1px solid var(--tr-card-border);
    user-select: none;
}

.tr-dot-sep {
    opacity: .5;
}

/* ─── QUICK INSERT (emoji chips) ───────────────────────── */
.tr-quick-insert {
    position: relative;
}

.tr-qi-scroll {
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tr-qi-scroll::-webkit-scrollbar {
    display: none;
}

.tr-qi-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: max-content;
}

.tr-qi-chip {
    width: 32px;
    height: 32px;
    border-radius: var(--tr-radius-sm);
    border: 1px solid var(--tr-card-border);
    background: var(--tr-card-bg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr-transition);
}

/* .tr-qi-chip:hover {
    background: var(--tr-primary-light);
    transform: scale(1.12);
    border-color: rgba(99, 102, 241, .3);
} */

.tr-qi-chip--more {
    font-size: 18px;
    font-weight: 600;
    color: var(--tr-text-muted);
    background: var(--tr-primary-light);
    border-color: rgba(99, 102, 241, .2);
}


/* ─── EMOJI PICKER DROPDOWN ────────────────────────────── */
.tr-emoji-picker {
    position: absolute;
    bottom: -90%;
    /* left: 0; */
    right: 10%;
    z-index: 999;
    margin-bottom: 8px;
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-card-border);
    border-radius: var(--tr-radius);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .15), 0 -4px 12px rgba(99, 102, 241, .08);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: trEmojiSlideIn .25s ease;
    width: 295px;
}

.tr-emoji-picker.open {
    display: flex;
}

@keyframes trEmojiSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Picker Header / Search */
.tr-emoji-picker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--tr-card-border);
}

.tr-emoji-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--tr-card-border);
    border-radius: var(--tr-radius-sm);
    background: var(--tr-surface-2);
    color: var(--tr-text-main);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color var(--tr-transition);
}

.tr-emoji-search:focus {
    border-color: rgba(99, 102, 241, .4);
}

.tr-emoji-search::placeholder {
    color: var(--tr-text-muted);
}

.tr-emoji-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--tr-surface-3);
    color: var(--tr-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--tr-transition);
    flex-shrink: 0;
}

.tr-emoji-close-btn:hover {
    background: var(--tr-rose-bg);
    color: var(--tr-rose);
}

/* Picker Category Tabs */
.tr-emoji-categories {
    display: flex;
    gap: 2px;
    padding: 6px 14px;
    overflow-x: auto;
    border-bottom: 1px solid var(--tr-card-border);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tr-emoji-categories::-webkit-scrollbar {
    display: none;
}

.tr-emoji-cat-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--tr-text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--tr-transition);
}

.tr-emoji-cat-btn:hover {
    background: var(--tr-surface-3);
    color: var(--tr-text-main);
}

.tr-emoji-cat-btn.active {
    background: var(--tr-primary-light);
    color: var(--tr-primary);
}

/* Picker Grid */
.tr-emoji-grid-wrap {
    height: 190px;
    overflow-y: auto;
    padding: 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, .2) transparent;
}

.tr-emoji-grid-wrap::-webkit-scrollbar {
    width: 5px;
}

.tr-emoji-grid-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.tr-emoji-grid-wrap::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .2);
    border-radius: 10px;
}

.tr-emoji-cat-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tr-text-muted);
    margin: 10px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--tr-card-border);
}

.tr-emoji-cat-title:first-child {
    margin-top: 0;
}

.tr-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
}

.tr-emoji-item {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}

.tr-emoji-item:hover {
    background: var(--tr-primary-light);
    transform: scale(1.2);
}

.tr-emoji-empty {
    padding: 30px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--tr-text-muted);
}

/* ─── REPETITION COUNT ──────────────────────────────────── */
.tr-count-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tr-count-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ffff;
    border: 1px solid rgb(48 48 48 / 17%);
    border-radius: 10px;
    padding: 4px;
    width: 100%;
}

.tr-count-btn {
    width: 25%;
    height: 32px;
    border-radius: var(--tr-radius-sm);
    border: none;
    background: transparent;
    color: var(--tr-text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: all .18s;
}

.tr-count-btn:hover {
    background: var(--tr-surface-3);
    color: var(--tr-primary);
}

.tr-count-input {
    width: 50%;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--tr-text-main);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-body);
    outline: none;
}

.tr-count-times {
    font-size: 13.5px;
    color: var(--tr-text-muted);
}

.tr-preset-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tr-preset {
    padding: 6px;
    flex-grow: 1;
    border-radius: var(--tr-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tr-text-muted);
    background: var(--tr-surface-2);
    border: 1.5px solid var(--tr-card-border);
    cursor: pointer;
    transition: all var(--tr-transition);
}

.tr-preset:hover {
    border-color: rgba(99, 102, 241, .25);
    color: var(--tr-primary);
    background: var(--tr-primary-light);
}

.tr-preset.active {
    background: var(--tr-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

/* ─── SEPARATOR ─────────────────────────────────────────── */
.tr-separator-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tr-separator-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgb(48 48 48 / 17%);
    color: var(--tr-text-main);
    font-family: var(--font-body);
    font-size: 13.5px;
    outline: none;
    background: #ffff;
    transition: border-color var(--tr-transition), background var(--tr-transition);
}

.tr-separator-input:focus {
    border-color: rgba(99, 102, 241, .35);
    background: var(--tr-card-bg);
}

.tr-sep-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tr-sep-btn {
    flex-grow: 1;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--tr-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-text-muted);
    background: var(--tr-surface-2);
    border: 1.5px solid var(--tr-card-border);
    cursor: pointer;
    transition: all var(--tr-transition);
}

.tr-sep-btn:hover {
    border-color: rgba(99, 102, 241, .25);
    color: var(--tr-primary);
    background: var(--tr-primary-light);
}

.tr-sep-btn.active {
    background: var(--tr-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

/* ─── REPEAT BY TABS ────────────────────────────────────── */
.tr-repeat-by-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tr-by-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--tr-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tr-text-muted);
    background: var(--tr-surface-2);
    border: 1.5px solid var(--tr-card-border);
    cursor: pointer;
    transition: all var(--tr-transition);
}

.tr-by-btn:hover {
    border-color: rgba(99, 102, 241, .25);
    color: var(--tr-primary);
    background: var(--tr-primary-light);
}

.tr-by-btn.active {
    background: var(--tr-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

/* ─── REPEAT CTA BUTTON ─────────────────────────────────── */
.tr-repeat-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--tr-primary);
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .3);
    margin-top: 6px;
}

.tr-repeat-btn:hover {
    background: var(--tr-primary-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .45);
}

.tr-repeat-btn:active {
    transform: translateY(0);
}

/* ─── OUTPUT PANEL ──────────────────────────────────────── */
.tr-output-card {
    height: 100%;
    min-height: 393px;
}

.tr-output-wrap {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 295px;
}

.tr-output-area {
    flex: 1;
    width: 100%;
    min-height: 295px;
    padding: 18px;
    border: none;
    background: var(--tr-card-bg);
    color: var(--tr-text-main);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.6;
    resize: none;
    outline: none;
    cursor: text;
}

.tr-output-area::placeholder {
    color: var(--tr-text-muted);
}

/* ─── EMPTY STATE ───────────────────────────────────────── */
.tr-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    pointer-events: none;
    opacity: 1;
    transition: opacity .2s ease;
    background: var(--tr-card-bg);
}

.tr-empty-state.hidden {
    opacity: 0;
    visibility: hidden;
}

.tr-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--tr-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tr-text-muted);
    opacity: .7;
}

.tr-empty-state p {
    font-size: 13.5px;
    color: var(--tr-text-muted);
    text-align: center;
    line-height: 1.6;
    margin: 0;
}

.tr-empty-state p strong {
    color: var(--tr-primary);
}

/* ─── STATS GRID ────────────────────────────────────────── */
.tr-output-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 20px;
    border-top: 1px solid var(--tr-toolbar-border);
    flex-shrink: 0;
    flex-wrap: wrap;
    background: var(--tr-surface-2);
}

.tr-output-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 20px;
}

.tr-stat-item {
    display: flex;
    /* flex-direction: column; */
    gap: 4px;
}

.tr-stat-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tr-text-muted);
}

.tr-stat-label svg {
    opacity: .7;
}

.tr-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--tr-text-main);
    line-height: 1.1;
}

/* ─── TIPS CARD ─────────────────────────────────────────── */
.tr-tips-card {
    background: #f5f3ff;
    border: 1px solid rgba(99, 102, 241, .15);
    border-radius: 16px;
    padding: 18px 24px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme="dark"] .tr-tips-card {
    background: rgba(99, 102, 241, .06);
    border-color: rgba(99, 102, 241, .2);
}

.tr-tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tr-primary);
}

.tr-tips-icon {
    flex-shrink: 0;
}

.tr-tips-header h3 {
    font-size: 14.5px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tr-tips-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.tr-tips-list li {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--tr-text-sub);
    margin-bottom: 6px;
}

.tr-tips-list li:last-child {
    margin-bottom: 0;
}

/* ─── DESCRIPTION / CONTENT SECTION ────────────────────── */
.tr-des {
    padding: 24px 28px;
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-card-border);
    border-radius: 16px;
    box-shadow: var(--tr-card-shadow);
}

.tr-des-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tr-divider);
}

.tr-des-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--tr-primary-light);
    color: var(--tr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tr-des-header h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--tr-text-main);
    margin: 0;
}

.tr-des-body p {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--tr-text-sub);
    margin: 0 0 14px;
}

.tr-des-body p strong {
    color: var(--tr-text-main);
    font-weight: 600;
}

.tr-des-body p code {
    font-family: monospace;
    font-size: 12.5px;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--tr-surface-2);
    color: var(--tr-primary);
    border: 1px solid var(--tr-card-border);
}

.tr-des-body h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--tr-text-main);
    margin: 24px 0 12px;
}

.tr-des-body ul {
    margin: 0 0 16px;
    padding-left: 20px;
    list-style-type: disc;
}

.tr-des-body li {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--tr-text-sub);
    margin-bottom: 6px;
}

.tr-des-body li strong {
    color: var(--tr-text-main);
    font-weight: 600;
}

/* ─── FEATURE BAR ───────────────────────────────────────── */
.tr-feature-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-card-border);
    border-radius: 16px;
    box-shadow: var(--tr-card-shadow);
    margin-bottom: 40px;
}

.tr-feature-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.tr-feature-main-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--tr-primary-light);
    color: var(--tr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tr-feature-main strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--tr-text-main);
    margin-bottom: 2px;
}

.tr-feature-main span {
    font-size: 12px;
    color: var(--tr-text-muted);
    line-height: 1.3;
}

.tr-feature-chips {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.tr-feature-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tr-chip-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--tr-radius-sm);
    background: var(--tr-surface-2);
    color: var(--tr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--tr-card-border);
}

.tr-feature-chip strong {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tr-text-main);
    margin-bottom: 1px;
}

.tr-feature-chip span {
    font-size: 11.5px;
    color: var(--tr-text-muted);
    line-height: 1.3;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
    .tr-workspace {
        grid-template-columns: 1fr;
    }

    .tr-output-card {
        min-height: 360px;
    }

    .tr-feature-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .tr-feature-chips {
        justify-content: flex-start;
        gap: 16px;
    }
}

@media (max-width: 680px) {
    .tr-page-wrapper {
        padding: 80px 0 40px;
    }

    .tr-des {
        padding: 20px;
    }

    .tr-feature-bar {
        padding: 16px 20px;
    }

    .tr-repeat-by-tabs {
        flex-direction: column;
    }

    .tr-by-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .tr-repetition-count-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .tr-output-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        width: 100%;
    }

    .tr-output-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .tr-output-footer .tr-action-btn--clear {
        width: 100%;
        justify-content: center;
    }

    .tr-qi-chip.emoji {
        display: none;
    }

    .tr-header-title-wrap .tr-header-text p {
        display: none;
    }

    .tr-action-btn.tr-action-btn--clear span {
        display: none;
    }
}

@media (max-width: 480px) {
    .tr-action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .tr-card-header {
        /* flex-direction: column; */
        /* align-items: flex-start; */
        gap: 5px;
        padding: 10px;
    }

    .tr-card-actions {
        /* width: 100%; */
        justify-content: flex-start;
    }

    .tr-card-body {
        padding: 10px;
    }
}