:root {
    --tte-panel: #ffffff;
    --tte-accent: #2563eb;
    --tte-text: #0f172a;
    --tte-muted: #696647;
    --tte-border: #e2e8f0;
    --tte-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


.tte_container {
    max-width: 1320px;
    margin: 0 auto;
}

.tte_header {
    background: #fff;
    border: 1px solid #d7e3ff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--tte-shadow);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.tte_header h1 {
    font-size: 26px;
    font-weight: 700;
}

.tte_header p {
    color: #334155;
    margin-top: 6px;
}

.tte_badge {
    padding: 8px 12px;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
}

.tte_grid {
    margin-top: 20px;
    display: flex;
    gap: 16px;
}

.tte_panel {
    background: var(--tte-panel);
    border: 1px solid var(--tte-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--tte-shadow);
}

.tte_grid>.tte_panel:first-child {
    flex: 1;
}

.tte_grid>.tte_panel:last-child {
    width: 400px;
    height: 700px;
    flex-shrink: 0;
}

.tte_panel.tte_wide {
    margin-top: 16px;
}

.tte_section-title {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #0f172a;
}

.tte_section-title span {
    color: var(--tte-muted);
    font-weight: 600;
    font-size: 13px;
}

.tte_section-title .tte_output-copy {
    margin-left: auto;
}

.tte_label {
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.tte_input,
.tte_textarea,
.tte_select {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--tte-border);
    color: var(--tte-text);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    transition: border 0.2s, box-shadow 0.2s;
}

.tte_textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.tte_input:focus,
.tte_textarea:focus,
.tte_select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.tte_row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.tte_row.tte_align-end {
    align-items: center;
}

.tte_row.tte_buttons {
    align-items: stretch;
}

.tte_share-row .tte_toggle {
    justify-content: flex-start;
    align-self: end;
    padding-bottom: 2px;
}

.tte_chip-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tte_chip {
    border: 1px solid var(--tte-border);
    background: #f8fafc;
    color: var(--tte-text);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, border 0.2s;
}

.tte_chip input {
    display: none;
}

.tte_chip.tte_active {
    background: #e0ecff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.tte_toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tte-muted);
}

.tte_toggle.tte_inline {
    justify-content: flex-end;
}

.tte_toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--tte-accent);
    cursor: pointer;
}

.tte_btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s, border 0.2s;
}

.tte_btn_recent_load {
    border-radius: 12px;
    padding: 6px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s, border 0.2s;
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: 0 1px 5px #0003, 0 2px 2px #00000024, 0 3px 1px -2px #0000001f;
}

.tte_btn-primary {
    background: linear-gradient(120deg, #2563eb, #60a5fa);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.tte_btn-ghost {
    background: #ffffff;
    border: 1px solid var(--tte-border);
    color: #0f172a;
}

.tte_btn-full {
    width: 100%;
}

.tte_btn:hover {
    transform: translateY(-1px);
}

.tte_btn:active {
    transform: translateY(0);
}

.tte_btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tte_status {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--tte-border);
    color: var(--tte-muted);
    min-height: 20px;
    background: #f8fafc;
}

.tte_status.tte_success {
    border-color: #34d399;
    color: #047857;
    background: #ecfdf3;
}

.tte_status.tte_error {
    border-color: #fca5a5;
    color: #b91c1c;
    background: #fef2f2;
}

.tte_status.tte_info {
    border-color: #dbeafe;
    color: #1d4ed8;
    background: #eef4ff;
}

.tte_action-row {
    margin-bottom: 12px;
}

.tte_output-box {
    background: #f8fafc;
    border: 1px solid var(--tte-border);
    border-radius: 14px;
    padding: 16px;
    min-height: 170px;
    line-height: 1.6;
    color: var(--tte-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.tte_meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    font-size: 14px;
    color: var(--tte-muted);
}

.tte_meta.tte_small {
    margin-top: -4px;
    margin-bottom: 6px;
}

.tte_meta strong {
    color: var(--tte-accent);
}

.tte_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    height: calc(100% - 50px);
}

.tte_panel.tte_wide .tte_list {
    max-height: none;
}

/* Compact list item card for public feed */
.tte_list-item {
    border: 1px solid var(--tte-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.tte_list-item-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tte_list-item-header>div:first-child {
    display: flex;
    flex-direction: column;
    align-items: baseline;
}

.tte_list-item-header strong {
    color: #0f172a;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.tte_meta-small {
    color: var(--tte-muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    max-width: 100%;
}

.tte_meta-small::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 10px;
    border: solid var(--tte-muted);
    border-width: 0px 0px 2px 2px;
    margin-right: 5px;
}

.tte_meta-time {
    font-size: 12px;
    color: #94a3b8;
}

.tte_list-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tte_btn-mode {
    border: 1px solid #bfdbfe;
    background: #eef4ff;
    color: #1d4ed8;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: default;
}

.tte_feedback-btn {
    border: 1px solid var(--tte-border);
    background: #f8fafc;
    color: #0f172a;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 13px;
    transition: border 0.2s, background 0.2s;
}

.tte_feedback-btn:hover {
    border-color: #bfdbfe;
    background: #f0f7ff;
}

/* Pending state for feedback buttons (client-side) */
.tte_feedback-btn.tte_pending {
    opacity: 0.85;
    position: relative;
    pointer-events: none;
}

.tte_feedback-btn.tte_pending::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-top-color: #2563eb;
    border-radius: 50%;
}

@keyframes tte-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pagination styles */
.tte_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 12px;
    flex-wrap: wrap;
}

.tte_pagination-btn {
    border: 1px solid var(--tte-border);
    background: #f8fafc;
    color: #0f172a;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: border 0.2s, background 0.2s, color 0.2s;
}

.tte_pagination-btn:hover:not(:disabled) {
    border-color: #bfdbfe;
    background: #e0ecff;
    color: #1d4ed8;
}

.tte_pagination-btn.tte_active {
    background: linear-gradient(120deg, #2563eb, #60a5fa);
    color: #ffffff;
    border-color: #2563eb;
}

.tte_pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tte_pagination-dots {
    color: var(--tte-muted);
    font-weight: 600;
}

.tte_btn-small {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.tte_output-copy {
    background: linear-gradient(120deg, #1d4ed8, #3b82f6);
    border-color: #1d4ed8;
    color: #ffffff;
}

.tte_output-copy:hover {
    background: linear-gradient(120deg, #1e40af, #2563eb);
    border-color: #1e40af;
}

.tte_output-share {
    margin-left: 8px;
}

/* SEO description panel */
.tte_panel-seo {
    padding: 20px;
}

.tte_seo-content {
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 55%);
    border-radius: 14px;
    padding: 16px;
    color: #1e293b;
    line-height: 1.75;
}

.tte_seo-content h2 {
    font-size: 22px;
    line-height: 1.35;
    margin: 0 0 10px;
    color: #0f172a;
}

.tte_seo-content h3 {
    font-size: 17px;
    line-height: 1.4;
    margin: 14px 0 6px;
    color: #0f172a;
}

.tte_seo-content p {
    margin: 0 0 10px;
    font-size: 15px;
}

.tte_seo-content ul,
.tte_seo-content ol {
    margin: 0 0 10px 20px;
}

.tte_seo-content li {
    margin-bottom: 4px;
}

.tte_seo-faq {
    margin-bottom: 0 !important;
}

.tte_seo-faq strong {
    color: #0f172a;
    margin-right: 4px;
}

/* Examples panel */
.tte_panel-examples {
    padding: 20px;
}

.tte_examples-intro {
    margin: -4px 0 14px;
    color: #475569;
    font-size: 14px;
}

.tte_examples-cta {
    margin: 12px 0 0;
}

.tte_examples-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tte_example-card {
    border: 1px solid var(--tte-border);
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tte_example-text,
.tte_example-output {
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 10px;
    line-height: 1.5;
    font-size: 14px;
}

.tte_example-text {
    background: #f8fafc;
    color: #0f172a;
}

.tte_example-output {
    background: #eef4ff;
    border-color: #dbeafe;
    color: #1e3a8a;
}

.tte_example_try {
    align-self: flex-start;
}

/* Dark mode (align with hm/style.css theme tones) */
body.dark-mode .tte_header,
body.dark-mode .tte_panel,
body.dark-mode .tte_list-item,
body.dark-mode .tte_card,
body.dark-mode .tte_example-card,
body.dark-mode .tte_seo-content {
    background: #303342;
    border-color: #7a7a7a;
    color: #bebebe;
}

body.dark-mode .tte_header h1,
body.dark-mode .tte_section-title,
body.dark-mode .tte_label,
body.dark-mode .tte_list-item-header strong,
body.dark-mode .tte_example-text strong,
body.dark-mode .tte_example-output strong,
body.dark-mode .tte_seo-content h2,
body.dark-mode .tte_seo-content h3,
body.dark-mode .tte_seo-content a,
body.dark-mode .tte_seo-faq strong,
body.dark-mode .panel-breadcrumb a,
body.dark-mode .tte_card .tte_preview,
body.dark-mode .tte_card .tte_meta-row span:not([class]) {
    color: #d9d9d9;
}

body.dark-mode .tte_header p,
body.dark-mode .tte_section-title span,
body.dark-mode .tte_toggle,
body.dark-mode .tte_meta,
body.dark-mode .tte_meta-small,
body.dark-mode .tte_meta-time,
body.dark-mode .tte_examples-intro,
body.dark-mode .tte_empty {
    color: #bebebe;
}

body.dark-mode .tte_badge {
    background: #262730;
    border-color: #7a7a7a;
    color: #d9d9d9;
}

body.dark-mode .tte_input,
body.dark-mode .tte_textarea,
body.dark-mode .tte_select,
body.dark-mode .tte_output-box,
body.dark-mode .tte_status,
body.dark-mode .tte_example-text,
body.dark-mode .tte_example-output {
    background: #262730;
    border-color: #7a7a7a;
    color: #bebebe;
}

body.dark-mode .tte_input:focus,
body.dark-mode .tte_textarea:focus,
body.dark-mode .tte_select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

body.dark-mode .tte_chip {
    background: #262730;
    border-color: #7a7a7a;
    color: #bebebe;
}

body.dark-mode .tte_btn-ghost,
body.dark-mode .tte_btn_recent_load,
body.dark-mode .tte_feedback-btn,
body.dark-mode .tte_pagination-btn {
    background: #262730;
    border-color: #7a7a7a;
    color: #d9d9d9;
}

body.dark-mode .tte_chip.tte_active,
body.dark-mode .tte_pagination-btn.tte_active {
    background: #1f3c67;
    border-color: #60a5fa;
    color: #dbeafe;
}

body.dark-mode .tte_feedback-btn:hover,
body.dark-mode .tte_pagination-btn:hover:not(:disabled) {
    background: #343848;
    border-color: #93c5fd;
}

body.dark-mode .tte_btn-mode,
body.dark-mode .tte_tag,
body.dark-mode .tte_btn-ghost {
    background: #1f3c67;
    border-color: #60a5fa;
    color: #dbeafe;
}

body.dark-mode .tte_output-copy {
    background: linear-gradient(120deg, #1e40af, #2563eb);
    border-color: #1d4ed8;
    color: #ffffff;
}

body.dark-mode .tte_output-copy:hover {
    background: linear-gradient(120deg, #1e3a8a, #1d4ed8);
    border-color: #1e3a8a;
}

body.dark-mode .tte_status.tte_success {
    background: #15352b;
    border-color: #2e7d5c;
    color: #7ee8bc;
}

body.dark-mode .tte_status.tte_error {
    background: #3f2328;
    border-color: #9f4e57;
    color: #ffb8c0;
}

body.dark-mode .tte_status.tte_info {
    background: #1f3c67;
    border-color: #60a5fa;
    color: #dbeafe;
}

body.dark-mode .tte_list::-webkit-scrollbar,
body.dark-mode .tte_grid>.tte_panel:last-child::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode .tte_list::-webkit-scrollbar-track,
body.dark-mode .tte_grid>.tte_panel:last-child::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode .tte_list::-webkit-scrollbar-thumb,
body.dark-mode .tte_grid>.tte_panel:last-child::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 4px;
}

.tte_card {
    border: 1px solid var(--tte-border);
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.tte_card .tte_preview {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
}

.tte_card .tte_meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    color: var(--tte-muted);
}

.tte_tag {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--tte-border);
    font-weight: 700;
    color: #1d4ed8;
    background: #eef4ff;
}

.tte_actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tte_actions.tte_center {
    justify-content: center;
}

.tte_empty {
    text-align: center;
    color: var(--tte-muted);
    padding: 12px;
}

@media (max-width: 980px) {
    .tte_grid {
        flex-direction: column;
    }

    .tte_grid>.tte_panel:last-child {
        width: 100%;
        height: auto;
        max-height: 450px;
        overflow-y: auto;
    }

    .tte_header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tte_row.tte_buttons {
        grid-template-columns: 1fr;
    }

    .tte_toggle.tte_inline {
        justify-content: flex-start;
    }

    .tte_panel-seo {
        padding: 16px;
    }

    .tte_seo-content h2 {
        font-size: 20px;
    }

    .tte_panel-examples {
        padding: 16px;
    }

    .tte_examples-grid {
        grid-template-columns: 1fr;
    }
}

/* Size mobi : 100% */
@media (max-width: 550px) {
    .tte_panel-seo {
        padding: 14px;
    }

    .tte_seo-content {
        padding: 14px;
        line-height: 1.65;
    }

    .tte_seo-content h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .tte_seo-content h3 {
        font-size: 16px;
        margin-top: 12px;
    }

    .tte_seo-content p,
    .tte_seo-content li {
        font-size: 14px;
    }

    .tte_seo-content ul,
    .tte_seo-content ol {
        margin-left: 18px;
    }

    .tte_panel-examples {
        padding: 14px;
    }

    .tte_examples-intro {
        margin-bottom: 10px;
        font-size: 13px;
    }

    .tte_example-card {
        padding: 10px;
        gap: 7px;
    }

    .tte_example-text,
    .tte_example-output {
        font-size: 13px;
    }
}