.tm-page {
    max-width: 640px;
    margin: 0 auto;
}

.tm-card {
    margin-bottom: 20px;
    padding: 1.5rem 1.35rem;
}

@media (min-width: 576px) {
    .tm-card {
        padding: 1.65rem 1.75rem;
    }
}

.tm-header {
    margin-bottom: 1.35rem;
}

.tm-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.tm-lead {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.tm-lead a {
    color: #38bdf8;
}

/* Блок адреса */
.tm-mail-section {
    margin-top: 0.25rem;
}

.tm-mail-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tm-mail-frame {
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(
        135deg,
        rgba(52, 211, 153, 0.55),
        rgba(56, 189, 248, 0.45) 45%,
        rgba(167, 139, 250, 0.4)
    );
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(52, 211, 153, 0.08);
}

.tm-mail-frame-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 12px 14px 12px 16px;
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(10, 18, 16, 0.98), rgba(6, 12, 10, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tm-mail-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.22);
    color: var(--emerald-light, #6ee7b7);
}

.tm-mail-icon svg {
    width: 22px;
    height: 22px;
}

.tm-email-out {
    flex: 1;
    min-width: 0;
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: clamp(13px, 2.8vw, 15px);
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-all;
}

.tm-email-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

.tm-mail-copy-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.tm-mail-copy-icon:hover:not(:disabled) {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.4);
    color: var(--emerald-light, #6ee7b7);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
}

.tm-mail-copy-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tm-mail-copy-icon svg {
    width: 20px;
    height: 20px;
}

/* Кнопки в один ряд, компактные */
.tm-btn-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 1 auto;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
}

.tm-btn-ico {
    display: flex;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tm-btn-ico svg {
    width: 18px;
    height: 18px;
}

.tm-btn-ico--sm {
    width: 16px;
    height: 16px;
}

.tm-btn-ico--sm svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 380px) {
    .tm-btn-row {
        flex-wrap: wrap;
    }
    .tm-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
}

.tm-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.tm-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex: 0 0 auto;
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
}

.tm-auto {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.tm-auto input[type='checkbox'] {
    width: 17px;
    height: 17px;
    accent-color: var(--emerald, #10b981);
}

.tm-error {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #f87171;
    font-size: 14px;
}

.tm-inbox-head {
    margin-top: 1.35rem;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tm-h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.tm-loading,
.tm-empty {
    font-size: 14px;
    color: var(--text-muted);
    padding: 14px 0 8px;
}

.tm-empty {
    padding: 16px 14px;
    margin-top: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    text-align: center;
    line-height: 1.5;
}

.tm-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.tm-item {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
    background: rgba(0, 0, 0, 0.14);
}

.tm-item:hover {
    background: rgba(52, 211, 153, 0.07);
    border-color: rgba(52, 211, 153, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tm-item-from {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.tm-item-subj {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.tm-item-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    font-family: 'Space Mono', ui-monospace, monospace;
}

.tm-detail {
    padding: 1.35rem 1.5rem;
    border-radius: var(--border-radius, 16px);
    border: 1px solid rgba(52, 211, 153, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.tm-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.tm-detail-head .tm-h3 {
    font-size: 16px;
    line-height: 1.3;
}

.tm-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.tm-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    max-height: 420px;
    overflow: auto;
    font-family: inherit;
}

/* Тёмные кнопки Bootstrap под стекло */
.tm-page .btn-primary {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.9), rgba(16, 185, 129, 0.85));
    border: none;
    color: #042f2e;
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
}

.tm-page .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
    color: #022c22;
    box-shadow: 0 6px 24px rgba(52, 211, 153, 0.35);
}

.tm-page .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tm-page .btn-outline-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--text-primary);
}
