* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    color: #111827;
    font-size: 14px;
}

body.panel-body,
body.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 22%),
        linear-gradient(180deg, #fafbfc 0%, #f5f7fa 52%, #edf1f5 100%);
}

a {
    text-decoration: none;
    transition: all 0.18s ease;
}

img {
    max-width: 100%;
    display: block;
}

/* LOGIN */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(249,250,252,0.98) 100%);
    border: 1px solid #e7ebf0;
    border-radius: 22px;
    padding: 24px;
    box-shadow:
        0 24px 50px rgba(17, 24, 39, 0.08),
        0 8px 18px rgba(17, 24, 39, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.login-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.login-subtitle {
    margin: 8px 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-actions {
    margin-top: 4px;
}

.login-footer-note {
    margin: 16px 0 0;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

/* MAIN LAYOUT */
.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 14px;
    padding: 10px;
}

/* SIDEBAR */
/* SIDEBAR */
.sidebar {
    position: sticky;
    top: 10px;
    height: calc(100vh - 20px);
    padding: 18px 10px 14px;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f6 52%, #e8edf3 100%);
    border: 1px solid #dde4ec;
    border-radius: 26px;
    box-shadow:
        0 20px 38px rgba(15, 23, 42, 0.08),
        0 8px 18px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        inset 1px 0 0 rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-brand {
    padding: 6px 4px 0;
    margin-bottom: 42px;
}

.sidebar-logo-link {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    min-height: 120px;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.sidebar-logo {
    width: 100%;
    max-width: 185px;
    max-height: 110px;
    object-fit: contain;
    transform: scale(1.12);
    transform-origin: top center;
}

.sidebar-nav,
.sidebar-bottom {
    display: grid;
    gap: 8px;
}

.sidebar-nav {
    margin-top: 6px;
}

.sidebar-bottom {
    margin-top: 20px;
}

.nav-item,
.nav-button {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 14px;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(248,250,252,0.62) 100%);
    border: 1px solid rgba(209, 213, 219, 0.72);
    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.03),
        inset 0 1px 0 rgba(255,255,255,0.88);
}

.nav-button {
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover,
.nav-button:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(243,246,249,0.96) 100%);
    border-color: #cfd7e2;
    color: #111827;
    transform: translateX(1px);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.95);
}

.nav-item.active {
    color: #111827;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fa 100%);
    border-color: #d7dee7;
    box-shadow:
        0 10px 18px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.98);
}

/* TOPBAR */
.main-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 10px;
    z-index: 20;
    min-height: 72px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow:
        0 14px 26px rgba(17, 24, 39, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.topbar-title {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.topbar-subtitle {
    margin: 3px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
    color: #ffffff;
    background: linear-gradient(180deg, #7b8491 0%, #596272 100%);
    box-shadow: 0 8px 14px rgba(17, 24, 39, 0.14);
}

.user-meta {
    display: grid;
    gap: 1px;
}

.user-meta strong {
    font-size: 12px;
    color: #111827;
}

.user-meta span {
    font-size: 10px;
    color: #6b7280;
}

/* BUTTONS */
.btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-outline {
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow:
        0 8px 18px rgba(17, 24, 39, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.btn-outline:hover {
    transform: translateY(-1px);
    border-color: #9ca3af;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(180deg, #7b8491 0%, #596272 100%);
    border-color: rgba(75, 85, 99, 0.25);
    box-shadow:
        0 10px 18px rgba(17, 24, 39, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #6f7886 0%, #4f5765 100%);
}

/* CONTENT */
.content-area {
    padding: 18px 6px 6px 6px;
}

.hero-card,
.modern-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,250,252,0.97) 100%);
    border: 1px solid #e7ebf0;
    border-radius: 22px;
    box-shadow:
        0 16px 30px rgba(17, 24, 39, 0.045),
        0 6px 14px rgba(17, 24, 39, 0.02),
        inset 0 1px 0 rgba(255,255,255,0.94);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 28px 30px;
}

.hero-card-compact {
    min-height: 180px;
    display: flex;
    align-items: center;
}

.hero-card::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -70px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(203, 213, 225, 0.28), transparent 68%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
    background: #f8fafc;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
}

.hero-text h2 {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #111827;
}

.hero-text p {
    margin: 0;
    max-width: 640px;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
}

/* SETTINGS */
.settings-card {
    padding: 22px;
    margin-bottom: 18px;
}

.settings-password-card {
    max-width: 760px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.settings-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.info-row {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #6b7280;
}

.info-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.settings-form {
    max-width: 100%;
}

.settings-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
}

/* FORMS */
.clean-form {
    display: grid;
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.clean-form label,
.login-form label {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.clean-form input,
.clean-form select,
.login-form input {
    width: 100%;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    padding: 0 13px;
    font-size: 13px;
    color: #111827;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        0 4px 10px rgba(17, 24, 39, 0.02);
    transition: all 0.2s ease;
}

.clean-form input:focus,
.clean-form select:focus,
.login-form input:focus {
    border-color: #9ca3af;
    box-shadow:
        0 0 0 4px rgba(156, 163, 175, 0.16),
        0 8px 18px rgba(17, 24, 39, 0.05);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ALERT */
.alert {
    margin-bottom: 14px;
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.55;
}

.alert-success {
    background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 100%);
    color: #166534;
    border: 1px solid #bbf7d0;
    box-shadow: 0 8px 16px rgba(22, 101, 52, 0.05);
}

.alert-error {
    background: linear-gradient(180deg, #fef2f2 0%, #fff1f2 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
    box-shadow: 0 8px 16px rgba(153, 27, 27, 0.05);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 620px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,249,251,0.99) 100%);
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 20px;
    box-shadow:
        0 28px 50px rgba(17, 24, 39, 0.15),
        0 10px 22px rgba(17, 24, 39, 0.07),
        inset 0 1px 0 rgba(255,255,255,0.95);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.modal-header p {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.modal-close {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-form {
    gap: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    .sidebar {
        position: relative;
        top: 0;
        height: auto;
    }

    .topbar {
        top: 0;
    }
}

@media (max-width: 900px) {
    .settings-info-grid {
        grid-template-columns: 1fr;
    }

    .settings-password-card {
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    .topbar {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .content-area {
        padding: 16px 2px 2px 2px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 18px;
        border-radius: 18px;
    }

    .hero-text h2 {
        font-size: 24px;
    }
}
/* DASHBOARD SECTIONS */
.dashboard-section {
    margin-top: 18px;
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header h3 {
    margin: 4px 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.section-header p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
    max-width: 720px;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

/* EMPTY STATE */
.empty-state-box {
    padding: 24px;
    border: 1px dashed #d5dbe3;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.95),
        0 10px 22px rgba(17, 24, 39, 0.03);
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(180deg, #7b8491 0%, #596272 100%);
    box-shadow: 0 12px 20px rgba(17, 24, 39, 0.12);
    flex: 0 0 auto;
}

.empty-state-text {
    flex: 1;
}

.empty-state-text h4 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.empty-state-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
}

/* GOOGLE ACCOUNTS */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.account-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.98) 100%);
    box-shadow:
        0 14px 28px rgba(17, 24, 39, 0.04),
        inset 0 1px 0 rgba(255,255,255,0.95);
}

.account-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(180deg, #7b8491 0%, #596272 100%);
    box-shadow: 0 12px 20px rgba(17, 24, 39, 0.12);
    flex: 0 0 auto;
}

.account-main {
    min-width: 0;
    flex: 1;
}

.account-main h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    word-break: break-word;
}

.account-main p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    word-break: break-word;
}

.account-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pill-success {
    color: #166534;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.status-pill-info {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.status-pill-muted {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.account-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.account-meta-item {
    padding: 12px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: rgba(255,255,255,0.88);
}

.account-meta-label {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.account-meta-item strong {
    font-size: 12px;
    line-height: 1.5;
    color: #111827;
    word-break: break-word;
}

/* GOOGLE CONNECT MODAL */
.modal-card-medium {
    max-width: 640px;
}

.google-connect-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    margin-bottom: 16px;
}

.google-connect-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(180deg, #7b8491 0%, #596272 100%);
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.12);
    flex: 0 0 auto;
}

.google-connect-content h4 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.google-connect-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
}

/* RESPONSIVE EXTRA */
@media (max-width: 1024px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .empty-state-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-card-top {
        flex-direction: column;
    }

    .account-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .account-meta-grid {
        grid-template-columns: 1fr;
    }

    .google-connect-box {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* INBOX PAGE */
.inbox-filters-form {
    margin-top: 4px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 14px;
}

.filters-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.threads-list {
    display: grid;
    gap: 14px;
}

.thread-row-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.98) 100%);
    box-shadow:
        0 10px 22px rgba(17, 24, 39, 0.04),
        inset 0 1px 0 rgba(255,255,255,0.95);
    padding: 18px;
}

.thread-row-main {
    display: grid;
    gap: 12px;
}

.thread-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.thread-row-left {
    min-width: 0;
    flex: 1;
}

.thread-subject {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    word-break: break-word;
}

.thread-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thread-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.thread-row-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.thread-direction-in {
    color: #166534;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.thread-direction-out {
    color: #7c2d12;
    background: #fff7ed;
    border-color: #fed7aa;
}

.thread-unread-pill {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.thread-snippet {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
}

.thread-row-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.thread-date {
    font-size: 12px;
    color: #6b7280;
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
}

@media (max-width: 900px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .thread-row-top,
    .thread-row-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .thread-row-right {
        justify-content: flex-start;
    }
}
/* THREAD DETAIL PAGE */
.threads-list-pro {
    gap: 16px;
}

.thread-row-card-pro {
    padding: 20px;
    border-radius: 20px;
}

.thread-row-top-pro {
    gap: 18px;
}

.thread-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.thread-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #166534;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.thread-summary-grid,
.thread-header-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 14px;
}

.thread-summary-item {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.thread-summary-label {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.thread-summary-item strong {
    font-size: 12px;
    line-height: 1.5;
    color: #111827;
    word-break: break-word;
}

.thread-actions-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thread-view-list {
    display: grid;
    gap: 16px;
}

.message-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    box-shadow:
        0 10px 18px rgba(17, 24, 39, 0.04),
        inset 0 1px 0 rgba(255,255,255,0.94);
}

.message-card-in {
    border-left: 5px solid #86efac;
}

.message-card-out {
    border-left: 5px solid #fdba74;
}

.message-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.message-card-author {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    word-break: break-word;
}

.message-card-meta {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.message-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.message-fields {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #374151;
}

.message-body {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 14px;
}

.message-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: #111827;
}

.textarea-control {
    width: 100%;
    min-height: 220px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #111827;
    outline: none;
    resize: vertical;
    font-family: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        0 4px 10px rgba(17, 24, 39, 0.02);
}

.textarea-control:focus {
    border-color: #9ca3af;
    box-shadow:
        0 0 0 4px rgba(156, 163, 175, 0.16),
        0 8px 18px rgba(17, 24, 39, 0.05);
}

@media (max-width: 1100px) {
    .thread-summary-grid,
    .thread-header-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .thread-summary-grid,
    .thread-header-meta {
        grid-template-columns: 1fr;
    }

    .message-card-top {
        flex-direction: column;
    }
}