* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Login Page Styles */
.login-container {
    position: relative;
    height: 100vh;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.login-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.dashboard-header .logo {
    flex-direction: row;
    gap: 0;
    margin-bottom: 0;
}

.logo-icon {
    width: 200px;
    height: 100px;
    background-image: url('../bubbles_1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 6px;
}

.login-container .logo-icon {
    background-image: url('../bubbles_2.png');
}

.dashboard-header .logo-icon {
    width: 90px;
    height: 45px;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.login-form {
    max-width: 400px;
    width: 100%;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.subtitle {
    color: #666;
    font-size: 15px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.btn-google {
    width: 100%;
    background: white;
    color: #1a1a1a;
    border: 1px solid #d1d5db;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 24px;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.illustration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10%;
}

.illustration svg {
    width: 50vw;
    height: auto;
    max-width: 800px;
}

.decoration {
    position: absolute;
    opacity: 0.25;
    z-index: 0;
}

.decoration-circle {
    width: 60px;
    height: 60px;
    border: 2px solid white;
    border-radius: 50%;
}

.decoration-x {
    font-size: 24px;
    color: white;
    font-weight: 300;
}

.decoration-line {
    width: 40px;
    height: 2px;
    background: white;
}

/* Dashboard Styles */
.dashboard {
    display: none;
    min-height: 100vh;
    background: #f5f5f5;
    flex-direction: column;
}

.dashboard.active {
    display: flex;
}

.dashboard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    max-height: calc(100vh - 60px);
}

/* Sidebar Navigation */
.sidebar {
    width: 240px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-toggle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    stroke: white;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-menu {
    padding: 12px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 24px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar a.sidebar-item,
.sidebar a.sidebar-item:link,
.sidebar a.sidebar-item:visited,
.sidebar a.sidebar-item:hover,
.sidebar a.sidebar-item:active,
.sidebar a.sidebar-item:focus {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-item span {
    display: none;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.sidebar-item:focus,
.sidebar-item:active,
.sidebar-item:visited {
    text-decoration: none;
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sidebar a.sidebar-item.active,
.sidebar a.sidebar-item.active:link,
.sidebar a.sidebar-item.active:visited,
.sidebar a.sidebar-item.active:hover,
.sidebar a.sidebar-item.active:active,
.sidebar a.sidebar-item.active:focus {
    color: white;
    text-decoration: none;
}

.sidebar-item.active .sidebar-icon {
    stroke: white;
}

/* AI icon uses fill instead of stroke */
.sidebar-icon.sidebar-icon-fill {
    fill: rgba(255, 255, 255, 0.9);
    stroke: none;
}

.sidebar-item:hover .sidebar-icon.sidebar-icon-fill,
.sidebar-item.active .sidebar-icon.sidebar-icon-fill {
    fill: white;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    stroke: rgba(255, 255, 255, 0.9);
    fill: none;
    transition: stroke 0.2s ease, fill 0.2s ease;
}

.sidebar-item:hover .sidebar-icon {
    stroke: white;
    fill: none;
}

.dashboard-header {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    padding: 6px 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dashboard-user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dashboard-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dashboard-user .user-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-menu-icon {
    margin-left: 8px;
    transition: transform 0.2s ease;
    stroke: white;
}

.dashboard-user.active .user-menu-icon {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.user-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.user-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.user-menu-item:only-child {
    border-radius: 8px;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

.user-menu-item svg {
    stroke: #dc3545;
}

.user-menu-item span {
    font-size: 14px;
    font-weight: 500;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c82333;
}

.dashboard-content {
    flex: 1;
    overflow-y: scroll;
    background: #f5f5f5;
    padding: 24px 32px;
}

/* Custom scrollbar styling */
.dashboard-content::-webkit-scrollbar {
    width: 10px;
}

.dashboard-content::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 5px;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 5px;
}

.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: #7e22ce;
}

.content-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 28px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 8px;
    letter-spacing: 0;
}

.page-subtitle {
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-width: 1400px;
    margin-bottom: 10px;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
}

.stat-card-clickable {
    cursor: pointer;
}

.stat-card-clickable:hover {
    border-color: #9333ea;
}

.audit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.audit-filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.audit-window-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.audit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audit-field label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
}

.audit-field input {
    min-width: 210px;
    height: 36px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
}

.audit-grid-wrap {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: auto;
}

.audit-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.audit-grid th,
.audit-grid td {
    text-align: left;
    vertical-align: top;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f2;
    font-size: 12px;
    color: #202124;
}

.audit-grid th:nth-child(5),
.audit-grid td:nth-child(5) {
    min-width: 400px;
}

.audit-grid th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    font-size: 11px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5f6368;
    z-index: 1;
}

.audit-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #374151;
}

.audit-kv-row {
    display: grid;
    grid-template-columns: minmax(100px, 160px) 1fr;
    gap: 8px;
    align-items: start;
}

.audit-kv-row.nested {
    grid-template-columns: minmax(90px, 140px) 1fr;
}

.audit-kv-key {
    font-weight: 600;
    color: #4b5563;
    word-break: break-word;
}

.audit-kv-value {
    color: #111827;
    word-break: break-word;
}

.audit-kv-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    background: #fafafa;
}

.audit-kv-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audit-kv-empty {
    color: #6b7280;
}

.audit-empty {
    text-align: center;
    color: #5f6368;
    padding: 18px;
}

.stat-card-saved-time {
    grid-column: span 1;
}

.stat-card-updated-sources {
    grid-column: span 2;
}

.stat-card-mailbox-score {
    grid-column: span 1;
}

.stat-card-priority-counts {
    grid-column: span 1;
}

.stats-grid-dashboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid-dashboard .stat-card-saved-time {
    grid-column: 1;
    grid-row: 1;
}

.stats-grid-dashboard .stat-card-kanban-counts {
    grid-column: 2;
    grid-row: 1;
}

.stats-grid-dashboard .stat-card-priority-counts {
    grid-column: 3;
    grid-row: 1;
}

.stats-grid-dashboard .stat-card-mailbox-score {
    grid-column: 4;
    grid-row: 1;
}

.stats-grid-dashboard .stat-card-pending-action {
    grid-column: 1;
    grid-row: 2;
}

.stats-grid-dashboard .stat-card-updated-sources {
    grid-column: 2;
    grid-row: 2;
}

.stats-grid-dashboard .stat-card-total-emails {
    grid-column: 3;
    grid-row: 2;
}

.stats-grid-dashboard .stat-card-total-threads {
    grid-column: 4;
    grid-row: 2;
}

.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: auto 1fr auto;
    row-gap: 12px;
    height: 100%;
}

.stat-grid-head {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
}

.stat-grid-head .stat-title {
    grid-column: 1 / span 4;
}

.stat-grid-head .stat-icon {
    grid-column: 5 / span 2;
    justify-self: end;
}

.stat-grid-main {
    grid-column: 1 / -1;
}

.stat-grid-main-triple {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 8px;
}

.stat-grid-main-full {
    grid-column: 1 / -1;
}

.stat-grid-main-centered {
    grid-column: 2 / span 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-grid-foot {
    grid-column: 1 / -1;
}

.stat-metric-pair {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.stat-metric-value {
    font-size: 36px;
    font-weight: 600;
    color: #202124;
    line-height: 1.1;
}

.stat-metric-value-button {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 36px;
}

.stat-metric-value-button:hover {
    color: #9333ea;
}

.stat-metric-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
}

.stat-main-number {
    font-size: 42px;
    font-weight: 600;
    color: #202124;
    line-height: 1.1;
}

.stat-grid-main-split {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.activity-source-block {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    gap: 6px;
}

.activity-source-divider {
    border-right: 1px solid #e5e7eb;
}

.activity-source-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
}

.activity-source-value {
    font-size: 32px;
    font-weight: 600;
    color: #202124;
    line-height: 1.1;
}

.mailbox-score-gauge {
    --needle-angle: 0deg;
    --gauge-color: #34a853;
    width: 100%;
    max-width: 220px;
    height: 95px;
    margin: 12px auto 8px;
    position: relative;
}

.mailbox-score-gauge-svg {
    position: absolute;
    left: 50%;
    top: 0;
    width: 190px;
    height: 95px;
    transform: translateX(-50%);
}

.mailbox-score-gauge-track {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 12;
    stroke-linecap: round;
}

.mailbox-score-gauge-fill {
    fill: none;
    stroke: var(--gauge-color);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s ease, stroke 0.2s ease;
}

.mailbox-score-gauge-needle-wrap {
    position: absolute;
    left: 50%;
    top: 80px;
    width: 0;
    height: 0;
}

.mailbox-score-gauge-needle {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 7px;
    height: 59px;
    background: #202124;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    border-radius: 0 0 4px 4px;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(var(--needle-angle));
    transition: transform 0.35s ease;
}

.mailbox-score-gauge-needle::after {
    content: none;
}

.mailbox-score-gauge-pivot {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #202124;
    transform: translate(-50%, 50%);
}

.mailbox-score-gauge-value {
    position: absolute;
    left: 50%;
    top: 34px;
    transform: translateX(-50%);
}

.mailbox-score-gauge-value span {
    font-size: 28px;
    font-weight: 700;
    color: #202124;
    line-height: 1;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

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

.stat-title {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    background: #fce7f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ec4899;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-value-time {
    font-size: 36px;
}

.saved-time-value {
    display: flex;
    flex-direction: column;
    gap: 6px;
    --saved-time-col-width: 52px;
    --saved-time-col-gap: 8px;
}

.saved-time-numbers {
    display: grid;
    grid-template-columns: repeat(3, var(--saved-time-col-width));
    gap: var(--saved-time-col-gap);
    align-items: baseline;
    justify-content: start;
}

.saved-time-number {
    font-size: 36px;
    font-weight: 600;
    color: #202124;
    line-height: 1.1;
    letter-spacing: 0;
}

.saved-time-labels {
    display: grid;
    grid-template-columns: repeat(3, var(--saved-time-col-width));
    gap: var(--saved-time-col-gap);
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    text-transform: none;
    justify-content: start;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.stat-change-value {
    font-weight: 600;
    color: #34a853;
}

.stat-change-value.negative {
    color: #ea4335;
}

.stat-change-label {
    color: #5f6368;
    font-weight: 500;
}

/* Chart Card */
.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0 0 32px;
    max-width: 1400px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.chart-info {
    flex: 0 0 65%;
    max-width: 65%;
}

.chart-metrics {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    flex: 1;
}

.chart-avg-saved {
    min-width: 220px;
    border-left: 1px solid #e5e7eb;
    padding-left: 24px;
}

.chart-title {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 8px;
}

.chart-value {
    font-size: 32px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 4px;
    line-height: 1.2;
}

.chart-value-secondary {
    font-size: 28px;
}

.chart-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.chart-change-value {
    font-weight: 600;
    color: #34a853;
}

.chart-change-value.negative {
    color: #ea4335;
}

.chart-change-label {
    color: #5f6368;
    font-weight: 500;
}

.chart-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-day-navigation {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.chart-filter-btn {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-filter-btn:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.chart-filter-btn.active {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #1a73e8;
}

.chart-nav-btn {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-nav-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #5f6368;
}

.chart-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chart-day-label {
    min-width: 110px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
}

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1400px;
}

@media (max-width: 1024px) {
    .chart-metrics {
        gap: 24px;
    }

    .chart-avg-saved {
        min-width: 190px;
    }
}

@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: 16px;
    }

    .chart-metrics {
        width: 100%;
        justify-content: space-between;
        gap: 16px;
    }

    .chart-filters {
        align-self: flex-end;
    }

    .chart-avg-saved {
        min-width: 0;
        padding-left: 16px;
    }
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    border: 1px solid #dadce0;
}

.dashboard-card h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #202124;
}

.settings-section {
    padding: 0;
    overflow: hidden;
}

.settings-section-toggle {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    cursor: pointer;
    list-style: none;
}

.settings-section-toggle::-webkit-details-marker {
    display: none;
}

.settings-section-title {
    font-size: 20px;
    font-weight: 500;
    color: #202124;
}

.settings-section-chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid #5f6368;
    border-bottom: 2px solid #5f6368;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
    margin-right: 4px;
}

.settings-section[open] .settings-section-chevron {
    transform: rotate(45deg);
}

.settings-section-body {
    padding: 0 24px 24px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    transition: all 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.list-item {
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f9fafb;
}

.list-item h3 {
    color: #1a1a1a;
    font-size: 16px;
    margin-bottom: 6px;
}

.list-item p {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.list-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

#page-action-center.content-page.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#page-action-center .dashboard-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#page-action-center #actionCenterList {
    flex: 1;
    min-height: 0;
}

#page-action-center #actionCenterList .list-container {
    max-height: none;
    height: 100%;
    margin-bottom: 0;
}

#page-action-center #actionCenterList .list-item {
    cursor: pointer;
}

#page-action-center #actionCenterList .list-item:hover {
    border-color: #d8b4fe;
    background: #f8f5ff;
}

#page-action-center #actionCenterList .list-item.selected {
    border-color: #9333ea;
    box-shadow: inset 0 0 0 1px rgba(147, 51, 234, 0.2);
}

.btn-action {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    margin-top: 15px;
}

.btn-action:hover {
    background: #6d28d9;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f1f3f4;
}

.modal-body {
    padding: 24px;
}

.mail-compose-modal-content {
    width: min(80vw, 1400px);
    height: min(80vh, 980px);
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    min-width: 720px;
    min-height: 560px;
    position: relative;
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mail-compose-top-resize-handle {
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 12px;
    cursor: ns-resize;
    z-index: 5;
}

.mail-compose-top-resize-handle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 84px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
    transition: background 0.2s ease;
}

.mail-compose-top-resize-handle:hover::before,
.mail-compose-top-resize-handle.is-dragging::before {
    background: rgba(99, 102, 241, 0.75);
}

.mail-compose-modal-body {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.mail-compose-form {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mail-compose-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 24px 24px 0;
}

.mail-compose-footer {
    flex: 0 0 76px;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.mail-compose-footer-primary,
.mail-compose-footer-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .illustration {
        transform: scale(0.7);
    }
}

@media (max-width: 768px) {
    .mail-compose-modal-content {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        min-width: 0;
        min-height: 0;
        resize: none;
    }

    .mail-compose-scroll {
        padding: 20px 16px 0;
    }

    .mail-compose-footer {
        min-height: 88px;
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .mail-compose-footer-primary,
    .mail-compose-footer-secondary {
        width: 100%;
        justify-content: flex-end;
    }

    .sidebar {
        width: 72px;
    }
    
    .sidebar-item span {
        display: none;
    }
    
    .sidebar-item {
        justify-content: center;
        padding: 12px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .dashboard-content {
        padding: 16px;
    }
}

/* AI Assistant Styles */
.ai-chat-container {
    height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ai-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.ai-message-user {
    align-self: flex-end;
}

.ai-message-assistant {
    align-self: flex-start;
}

.ai-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.ai-message-content.ai-message-html {
    white-space: normal;
}

.ai-agent-response {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-agent-paragraph {
    margin: 0;
    line-height: 1.55;
}

.ai-agent-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-agent-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
}

.ai-agent-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
    font-size: 13px;
}

.ai-agent-table th,
.ai-agent-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.ai-agent-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.ai-agent-table tr:last-child td {
    border-bottom: none;
}

.ai-agent-sources {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
}

.ai-agent-sources-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.ai-agent-sources ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-verified-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-verified-title {
    font-weight: 600;
    color: #202124;
}

.ai-verified-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.ai-verified-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ai-verified-table th,
.ai-verified-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.ai-verified-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    position: sticky;
    top: 0;
    z-index: 1;
}

.ai-verified-table tr:last-child td {
    border-bottom: none;
}

.ai-verified-empty {
    margin: 0;
    color: #5f6368;
}

.ai-message-user .ai-message-content {
    background: #9333ea;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message-assistant .ai-message-content {
    background: white;
    color: #202124;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.ai-message-time {
    font-size: 11px;
    color: #5f6368;
    margin-top: 4px;
    padding: 0 8px;
}

.ai-message-user .ai-message-time {
    text-align: right;
}

.ai-user-status {
    margin-top: 6px;
    padding: 0 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    font-style: italic;
}

.ai-loading .ai-message-content {
    background: white;
    color: #5f6368;
    font-style: italic;
}

.ai-error .ai-message-content {
    background: #fee;
    color: #c00;
    border-color: #fcc;
}

.ai-input-container {
    display: flex;
    gap: 12px;
}

.ai-input-container textarea {
    flex: 1;
    resize: none;
    padding: 12px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    min-height: 48px;
    max-height: 120px;
}

.ai-input-container textarea:focus {
    outline: none;
    border-color: #9333ea;
}

.ai-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-quick-action {
    padding: 8px 16px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-quick-action:hover {
    background: #f8f9fa;
    border-color: #9333ea;
    color: #9333ea;
}

/* Kanban Board Styles */
.kanban-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.kanban-page-header .page-title {
    margin-bottom: 0;
}

.kanban-title-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-archived-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    user-select: none;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.kanban-archived-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #dadce0;
    transition: background 0.2s ease;
}

.kanban-archived-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.kanban-archived-toggle.is-on .kanban-archived-toggle-track {
    background: #8b5cf6;
}

.kanban-archived-toggle.is-on .kanban-archived-toggle-thumb {
    transform: translateX(16px);
}

.kanban-sort-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kanban-sort-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
}

.kanban-sort-select {
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    background: #fff;
}

.kanban-sort-select:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.12);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.kanban-board.show-archived {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.kanban-column-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.kanban-count {
    background: #8b5cf6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.kanban-column-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, border 0.2s;
}

.kanban-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    cursor: grab;
    transition: all 0.2s;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.kanban-column-content.drag-over {
    background: #f3e8ff;
    border: 2px dashed #8b5cf6;
    border-radius: 8px;
}

.kanban-card-subject {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kanban-card-metadata {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.kanban-card-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-card-messages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.kanban-card-attachments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #0f766e;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.kanban-card-aging {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    background: #f3e8ff;
    border: 1px solid #ddd6fe;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.kanban-pill-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.kanban-card-date {
    color: #999;
}

.kanban-card-deadline {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.eisenhower-page-header {
    margin-bottom: 18px;
}

.eisenhower-page-copy {
    margin: 0;
    max-width: 720px;
    font-size: 14px;
    color: #5f6368;
}

.eisenhower-header-controls {
    align-self: flex-start;
}

.eisenhower-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #4b5563;
}

.eisenhower-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.eisenhower-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.eisenhower-legend-swatch.priority-high {
    background: #dc2626;
}

.eisenhower-legend-swatch.priority-medium {
    background: #d97706;
}

.eisenhower-legend-swatch.priority-low {
    background: #475569;
}

.eisenhower-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.eisenhower-legend-dot.attention-immediate {
    background: #ef4444;
}

.eisenhower-legend-dot.attention-moderate {
    background: #f59e0b;
}

.eisenhower-legend-dot.attention-patient {
    background: #94a3b8;
}

.eisenhower-axis-title-row {
    margin: 0 0 10px 86px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    justify-items: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #6b7280;
    text-align: center;
}

.eisenhower-layout {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.eisenhower-axis-title-column {
    position: relative;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #6b7280;
    text-align: center;
}

.eisenhower-axis-title-column span {
    position: absolute;
    left: 50%;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
}

.eisenhower-axis-title-column span:first-child {
    top: 25%;
}

.eisenhower-axis-title-column span:last-child {
    top: 75%;
}

.eisenhower-matrix {
    position: relative;
    min-height: 720px;
    border: 1px solid #d9dde7;
    border-radius: 24px;
    overflow: hidden;
    background:
        linear-gradient(to right, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.35) calc(50% - 0.5px), rgba(148, 163, 184, 0.35) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(148, 163, 184, 0.35) calc(50% - 0.5px), rgba(148, 163, 184, 0.35) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        #f8fafc;
}

.eisenhower-quadrant {
    position: absolute;
    padding: 18px 20px;
    pointer-events: none;
}

.eisenhower-quadrant.quadrant-do {
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.9), rgba(255, 255, 255, 0));
}

.eisenhower-quadrant.quadrant-schedule {
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(225deg, rgba(219, 234, 254, 0.95), rgba(255, 255, 255, 0));
}

.eisenhower-quadrant.quadrant-delegate {
    bottom: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(45deg, rgba(255, 237, 213, 0.92), rgba(255, 255, 255, 0));
}

.eisenhower-quadrant.quadrant-eliminate {
    right: 0;
    bottom: 0;
    width: 50%;
    height: 50%;
    background: linear-gradient(315deg, rgba(226, 232, 240, 0.92), rgba(255, 255, 255, 0));
}

.eisenhower-quadrant-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.eisenhower-quadrant-header strong {
    font-size: 15px;
    color: #111827;
}

.eisenhower-quadrant-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.eisenhower-quadrant p {
    margin: 0;
    max-width: 240px;
    font-size: 12px;
    line-height: 1.45;
    color: #4b5563;
}

.eisenhower-matrix-items {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.eisenhower-matrix-empty {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.eisenhower-card {
    position: absolute;
    width: clamp(180px, 20vw, 240px);
    min-height: 126px;
    padding: 0;
    border-radius: 18px;
    border: 2px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
    text-align: left;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    overflow: hidden;
}

.eisenhower-card:hover {
    transform: translate(-50%, calc(-50% - 4px));
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.eisenhower-card.selected {
    border-color: #7c3aed;
    box-shadow: 0 20px 36px rgba(124, 58, 237, 0.2);
}

.eisenhower-card.status-in-progress {
    border-style: dashed;
}

.eisenhower-card.status-done {
    opacity: 0.72;
}

.eisenhower-card.status-archived {
    opacity: 0.46;
}

.eisenhower-card.priority-high {
    border-color: #dc2626;
}

.eisenhower-card.priority-medium {
    border-color: #d97706;
}

.eisenhower-card.priority-low {
    border-color: #64748b;
}

.eisenhower-card-anchor {
    display: block;
    height: 6px;
    width: 100%;
    background: currentColor;
    opacity: 0.12;
}

.eisenhower-card.priority-high .eisenhower-card-anchor {
    color: #dc2626;
}

.eisenhower-card.priority-medium .eisenhower-card-anchor {
    color: #d97706;
}

.eisenhower-card.priority-low .eisenhower-card-anchor {
    color: #64748b;
}

.eisenhower-card-body {
    padding: 14px 14px 16px;
}

.eisenhower-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.eisenhower-card-header .email-priority-pill {
    flex-shrink: 0;
}

.eisenhower-card-subject {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.eisenhower-card-sender {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eisenhower-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eisenhower-deadline-pill,
.eisenhower-attention-badge,
.eisenhower-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.eisenhower-deadline-pill {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.eisenhower-deadline-pill.is-overdue {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.eisenhower-attention-badge {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.eisenhower-attention-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.eisenhower-attention-badge.attention-immediate {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.eisenhower-attention-badge.attention-moderate {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #d97706;
}

.eisenhower-attention-badge.attention-patient {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

.eisenhower-status-badge.status-todo {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.eisenhower-status-badge.status-in-progress {
    background: #faf5ff;
    border-color: #d8b4fe;
    color: #7c3aed;
}

.eisenhower-status-badge.status-done {
    background: #ecfdf5;
    border-color: #86efac;
    color: #15803d;
}

.eisenhower-status-badge.status-archived {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

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

    .kanban-sort-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .eisenhower-axis-title-row {
        margin-left: 0;
    }

    .eisenhower-layout {
        grid-template-columns: 1fr;
    }

    .eisenhower-axis-title-column {
        display: none;
    }

    .eisenhower-matrix {
        min-height: 880px;
    }
}

@media (max-width: 640px) {
    .login-content {
        padding: 40px 24px;
        width: 95%;
    }
    
    .illustration {
        transform: scale(0.5);
    }

    .dashboard-header {
        padding: 16px 24px;
    }

    .dashboard-content {
        padding: 24px;
    }

    .eisenhower-legend {
        gap: 8px 10px;
    }

    .eisenhower-matrix {
        min-height: 1020px;
    }

    .eisenhower-card {
        width: min(220px, calc(100vw - 96px));
    }
    
    .ai-message {
        max-width: 95%;
    }
}

/* Analysis Rules Grid Styles */
.analysis-rules-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.analysis-rule-row {
    display: grid;
    grid-template-columns: 30px 150px 1fr 150px 150px 40px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.analysis-rule-row:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.analysis-rule-row.dragging {
    opacity: 0.5;
}

.drag-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 16px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle:active {
    cursor: grabbing;
}

.rule-text {
    font-size: 14px;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rule-description {
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rule-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.rule-toggle label {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

.rule-menu-button {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.rule-menu-button:hover {
    background: #e5e7eb;
    color: #6b7280;
}

.rule-context-menu {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 120px;
    overflow: hidden;
}

.menu-option {
    padding: 10px 16px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}

.menu-option:hover {
    background: #f3f4f6;
}

.menu-option:last-child {
    color: #dc2626;
}

.menu-option:last-child:hover {
    background: #fee2e2;
}

.action-priority-pills {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-priority-pill {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 9999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-priority-pill:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.action-priority-pill.high {
    color: #dc2626;
}

.action-priority-pill.medium {
    color: #f59e0b;
}

.action-priority-pill.low {
    color: rgb(59 130 246);
}

.action-priority-pill.is-selected {
    border-color: currentColor;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

.email-priority-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

.email-priority-pill.priority-high {
    color: #dc2626;
}

.email-priority-pill.priority-medium {
    color: #f59e0b;
}

.email-priority-pill.priority-low {
    color: rgb(59 130 246);
}

/* Mail Page Styles */
.mail-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 4px;
}

.mail-tab-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mail-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -6px;
}

.mail-tab:hover {
    color: #202124;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.mail-tab.active {
    color: #9333ea;
    border-bottom-color: #9333ea;
}

.mail-quick-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.mail-quick-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dadce0;
    border-radius: 999px;
    padding: 6px 12px;
    background: #fff;
    color: #5f6368;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mail-quick-filters-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.mail-quick-filters-toggle:hover {
    border-color: #9333ea;
    color: #9333ea;
    background: #f8f9fa;
}

.mail-quick-filters.expanded .mail-quick-filters-toggle svg {
    transform: rotate(180deg);
}

.mail-quick-filters-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mail-quick-filters.collapsed .mail-quick-filters-pills {
    display: none;
}

.mail-quick-filter {
    border: 1px solid #dadce0;
    border-radius: 999px;
    padding: 6px 12px;
    background: #fff;
    color: #5f6368;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mail-quick-filter:hover {
    border-color: #9333ea;
    color: #9333ea;
    background: #f8f9fa;
}

.mail-quick-filter.active {
    background: #9333ea;
    border-color: #9333ea;
    color: #fff;
}

.mail-search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.mail-search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #202124;
    background: #fff;
}

.mail-search-input:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.12);
}

.mail-search-actions {
    display: flex;
    gap: 8px;
}

.mail-search-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    background: #9333ea;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mail-search-btn.secondary {
    background: #e5e7eb;
    color: #374151;
}

.mail-search-status {
    margin-bottom: 12px;
    font-size: 13px;
    color: #5f6368;
}

.mail-list-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.mail-list {
    min-height: 400px;
}

.mail-item {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    grid-template-rows: auto auto;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s ease;
    align-items: center;
    border-left: 3px solid transparent;
}

.mail-item:hover {
    background: #f8f9fa;
}

.mail-item.selected {
    border-left-color: #ff0000;
    background: #fff5f5;
}

.mail-item:last-child {
    border-bottom: none;
}

.mail-item-from {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-item-subject {
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-item.unread .mail-item-subject {
    color: #202124;
    font-weight: 700;
}

.mail-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end;
    min-width: 200px;
}

.mail-item-details {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.mail-item-summary {
    font-size: 12px;
    color: #5f6368;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.mail-item-deadline {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

.mail-item-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.mail-item-attachments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #0f766e;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.mail-pill-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.mail-item-status {
    font-size: 12px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 4px 10px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
}

.mail-item-status.status-todo {
    color: #4338ca;
}

.mail-item-status.status-in-progress {
    color: #92400e;
}

.mail-item-status.status-done {
    color: #166534;
}

.mail-item-status.status-archived {
    color: #374151;
}

.mail-item-date {
    font-size: 12px;
    color: #5f6368;
    min-width: 80px;
    text-align: right;
    white-space: nowrap;
}

.mail-empty,
.mail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: #5f6368;
}

.mail-empty p,
.mail-error p {
    font-size: 16px;
    margin: 0;
}

.mail-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.pagination-info {
    font-size: 13px;
    color: #5f6368;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #9333ea;
    color: #9333ea;
}

.pagination-btn.active {
    background: #9333ea;
    color: white;
    border-color: #9333ea;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .mail-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .mail-quick-filters {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .mail-quick-filters-pills {
        width: 100%;
    }

    .mail-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .mail-search-actions {
        width: 100%;
    }

    .mail-search-btn {
        flex: 1;
    }

    .mail-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .mail-item-meta {
        justify-content: space-between;
        min-width: auto;
    }

    .mail-item-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mail-item-deadline {
        text-align: left;
    }
    
    .mail-pagination {
        flex-direction: column;
        gap: 12px;
    }

}

/* Conversation Panel Styles */
.conversation-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    min-height: 280px;
    max-height: calc(100vh - 24px);
    background: white;
    border-top: 2px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.conversation-top-resize-handle {
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 14px;
    cursor: ns-resize;
    z-index: 6;
}

.conversation-top-resize-handle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 92px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
    transition: background 0.2s ease;
}

.conversation-top-resize-handle:hover::before,
.conversation-top-resize-handle.is-dragging::before {
    background: rgba(99, 102, 241, 0.78);
}

.conversation-panel.active {
    transform: translateY(0);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.conversation-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.conversation-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-count {
    background: #e0e0e0;
    color: #5f6368;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.conversation-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mail-compose-btn {
    border: 1px solid #dadce0;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mail-compose-btn:hover {
    border-color: #9333ea;
    color: #9333ea;
    background: #f8f5ff;
}

.mail-compose-hint {
    margin-top: -8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #5f6368;
}

.mail-compose-attachments {
    display: none;
    margin-top: -2px;
    margin-bottom: 12px;
}

.mail-compose-attachments.has-files {
    display: grid;
    gap: 8px;
}

.mail-compose-attachments-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.mail-compose-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mail-compose-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
}

.mail-compose-attachment-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.mail-compose-attachment-name {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.mail-compose-attachment-size {
    font-size: 12px;
    color: #6b7280;
}

.mail-compose-attachment-remove {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 15px;
    line-height: 1;
}

.mail-compose-attachment-remove:hover {
    background: #e5e7eb;
    color: #111827;
}

.mail-compose-file-input {
    display: none;
}

.mail-compose-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.mail-compose-ai-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.mail-compose-ai-panel {
    margin-bottom: 14px;
    border: 1px solid #dbe2f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.mail-compose-ai-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.mail-compose-ai-status {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.mail-compose-ai-close {
    width: 30px;
    height: 30px;
}

.mail-compose-ai-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px 0;
}

.mail-compose-ai-action {
    display: grid;
    gap: 4px;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
}

.mail-compose-ai-action strong {
    font-size: 13px;
}

.mail-compose-ai-action span {
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
}

.mail-compose-ai-action:hover {
    border-color: #9333ea;
    background: #faf5ff;
}

.mail-compose-ai-panel-body {
    padding: 16px;
}

.mail-compose-ai-empty,
.mail-compose-ai-error {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.mail-compose-ai-error {
    color: #b91c1c;
}

.mail-compose-ai-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #374151;
}

.mail-compose-ai-result,
.mail-compose-ai-review {
    display: grid;
    gap: 14px;
}

.mail-compose-ai-result-header,
.mail-compose-ai-review-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mail-compose-ai-draft-preview {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    line-height: 1.7;
    white-space: normal;
}

.mail-compose-ai-review-section {
    display: grid;
    gap: 8px;
}

.mail-compose-ai-review-section strong {
    color: #111827;
}

.mail-compose-ai-review-section p,
.mail-compose-ai-review-section ul {
    margin: 0;
}

.mail-compose-ai-review-section ul {
    padding-left: 18px;
    color: #374151;
    display: grid;
    gap: 8px;
}

.mail-compose-ai-review-section li {
    line-height: 1.6;
}

.mail-compose-ai-verdict {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e5e7eb;
    color: #374151;
}

.mail-compose-ai-verdict.verdict-strong {
    background: #dcfce7;
    color: #166534;
}

.mail-compose-ai-verdict.verdict-good-with-minor-edits {
    background: #dbeafe;
    color: #1d4ed8;
}

.mail-compose-ai-verdict.verdict-needs-revision {
    background: #fef3c7;
    color: #92400e;
}

.mail-compose-ai-verdict.verdict-high-risk {
    background: #fee2e2;
    color: #b91c1c;
}

.mail-compose-ai-issue-severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    margin-right: 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mail-compose-ai-issue-severity.severity-high {
    color: #b91c1c;
}

.mail-compose-ai-issue-severity.severity-medium {
    color: #92400e;
}

.mail-compose-ai-issue-severity.severity-low {
    color: #1d4ed8;
}

.mail-compose-trigger {
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mail-compose-trigger:hover {
    border-color: #9333ea;
    color: #9333ea;
    background: #f8f5ff;
}

.mail-compose-editor {
    width: 100%;
    min-height: 220px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    background: #fff;
}

.mail-compose-signature {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.mail-compose-quote {
    margin-top: 14px;
}

.mail-compose-editor:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.mail-recipient-editor {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mail-recipient-editor:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.mail-recipient-editor.drag-over {
    border-color: #7c3aed;
    background: #f8f5ff;
}

.mail-recipient-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mail-recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    max-width: 320px;
    cursor: grab;
}

.mail-recipient-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-recipient-chip-remove {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.mail-recipient-chip-remove:hover {
    color: #111827;
}

.mail-recipient-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 180px;
    font-size: 14px;
    padding: 6px 4px;
    background: transparent;
}

.calendar-planner-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.calendar-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-page-header .page-title {
    margin-bottom: 0;
}

.calendar-ai-organizer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.calendar-ai-organizer-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex: 0 0 auto;
}

.calendar-month-panel,
.calendar-day-panel {
    padding: 20px;
}

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

.calendar-panel-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.calendar-month-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-viz-select {
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    padding: 7px 10px;
}

.calendar-viz-select:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.calendar-month-grid {
    position: relative;
}

.calendar-month-grid-layer {
    position: relative;
    z-index: 1;
}

.calendar-nav-btn {
    border: 1px solid #dadce0;
    background: #fff;
    color: #4b5563;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    border-color: #9333ea;
    color: #9333ea;
    background: #f8f5ff;
}

.calendar-weekdays,
.calendar-week-row-cells {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-week-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-week-row {
    position: relative;
}

.calendar-weekday {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

.calendar-day-cell {
    min-height: 82px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 9px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day-cell.heatmap {
    background: var(--calendar-heat-color, rgb(59 130 246 / 0.20));
    border-color: var(--calendar-heat-border, #93c5fd);
}

.calendar-day-cell:hover {
    border-color: #d8b4fe;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.1);
}

.calendar-day-cell.selected {
    border-color: #7c3aed;
    background: #f8f5ff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.35);
}

.calendar-day-cell.today {
    border-color: #a855f7;
}

.calendar-day-cell.empty {
    visibility: hidden;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.calendar-day-count {
    font-size: 11px;
    color: #6b7280;
}

.calendar-day-count.empty {
    color: #9ca3af;
}

.calendar-week-line-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.calendar-week-line-svg {
    width: 100%;
    height: 100%;
}

.calendar-line-guide {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 1;
    stroke-dasharray: 4 5;
    opacity: 0.55;
}

.calendar-line-path {
    fill: none;
    stroke: #ef4444;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

.calendar-line-dot {
    fill: #ef4444;
    stroke: #fff;
    stroke-width: 1.5;
}

.calendar-line-point {
    pointer-events: all;
}

.calendar-line-dot {
    cursor: pointer;
}

.calendar-line-hover-label {
    font-size: 10px;
    fill: #b91c1c;
    text-anchor: middle;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.calendar-line-point:hover .calendar-line-hover-label,
.calendar-line-point:focus .calendar-line-hover-label {
    opacity: 1;
}

.calendar-line-summary {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    background: #faf5ff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-line-summary-total {
    font-size: 13px;
    color: #4c1d95;
}

.calendar-line-summary-ranking {
    font-size: 12px;
    color: #6b21a8;
}

.calendar-line-label {
    font-size: 10px;
    fill: #b91c1c;
    text-anchor: middle;
    font-weight: 700;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.calendar-autoscroll-debug {
    margin: -8px 0 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.calendar-event-card {
    border: 1px solid #ebe6ff;
    border-left: 4px solid #7c3aed;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.calendar-event-time {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    margin-bottom: 6px;
}

.calendar-event-title {
    margin: 0 0 6px;
    font-size: 15px;
    color: #111827;
}

.calendar-event-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.45;
    white-space: pre-wrap;
}

.calendar-event-links-row {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-event-meta-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.calendar-event-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-event-link {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid #d8b4fe;
    background: #faf5ff;
    color: #6d28d9;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.calendar-event-link:hover {
    background: #f3e8ff;
}

.calendar-event-attendees {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-attendees-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-attendee-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    padding: 4px 10px;
}

.calendar-attendee-name {
    font-size: 12px;
    color: #374151;
}

.calendar-attendee-rsvp {
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 8px;
}

.calendar-attendee-rsvp-accepted {
    background: #dcfce7;
    color: #166534;
}

.calendar-attendee-rsvp-tentative {
    background: #fef3c7;
    color: #92400e;
}

.calendar-attendee-rsvp-declined {
    background: #fee2e2;
    color: #b91c1c;
}

.calendar-attendee-rsvp-needs-action {
    background: #e5e7eb;
    color: #374151;
}

.calendar-rsvp-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-rsvp-select-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.calendar-rsvp-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
}

.calendar-rsvp-select:focus {
    outline: 2px solid #c084fc;
    outline-offset: 1px;
}

.calendar-attendees-more {
    font-size: 12px;
    color: #6b7280;
}

.calendar-event-content {
    margin-top: 6px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.calendar-event-content p {
    margin: 0 0 8px;
}

.calendar-event-content p:last-child {
    margin-bottom: 0;
}

.calendar-day-empty {
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    padding: 18px;
    text-align: center;
    font-size: 14px;
    background: #f9fafb;
}

.calendar-ai-result {
    min-height: 100%;
    padding: 16px 20px 24px;
}

.calendar-ai-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: #374151;
    margin-bottom: 14px;
}

.calendar-ai-source-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e2d4ff;
    background: #ffffff;
    color: #312e81;
}

.calendar-ai-source-llm {
    border-color: #e2d4ff;
    background: #faf7ff;
    color: #4c1d95;
}

.calendar-ai-source-fallback {
    border-color: #d1d5db;
    background: #f9fafb;
    color: #374151;
}

@media (max-width: 700px) {
    .mail-compose-ai-actions {
        grid-template-columns: 1fr;
    }
}

.calendar-ai-analysis-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(45vh - 120px);
    overflow: auto;
}

.calendar-ai-json-fallback {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.calendar-ai-section-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #4c1d95;
}

.calendar-ai-section-card {
    border: 1px solid #e9ddff;
    border-radius: 12px;
    background: #faf7ff;
    padding: 12px 14px;
}

.calendar-ai-items {
    display: grid;
    gap: 10px;
}

.calendar-ai-item {
    border: 1px solid #e2d4ff;
    border-radius: 10px;
    background: #ffffff;
    padding: 10px 12px;
}

.calendar-ai-item h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #312e81;
}

.calendar-ai-item p {
    margin: 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.45;
}

.calendar-ai-item-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.calendar-ai-empty {
    font-size: 13px;
    color: #6b7280;
}

.calendar-ai-list {
    margin: 0 0 12px 18px;
    padding: 0;
    color: #374151;
}

.calendar-ai-list li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.calendar-ai-paragraph {
    margin: 0 0 10px;
    color: #374151;
    line-height: 1.45;
}

.calendar-ai-paragraph:last-child {
    margin-bottom: 0;
}

.calendar-ai-drawer {
    height: 45vh;
    z-index: 1050;
}

.calendar-ai-drawer .conversation-header {
    background: #f8f9fa;
}

.calendar-ai-drawer-content {
    display: block;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .calendar-planner-layout {
        grid-template-columns: 1fr;
    }

    .calendar-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.sort-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sort-btn svg {
    width: 20px;
    height: 20px;
    color: #5f6368;
}

.sort-btn:hover {
    background: #e0e0e0;
}

.ai-analyze-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-analyze-btn svg {
    width: 20px;
    height: 20px;
    color: #673ab7;
}

.ai-analyze-btn:hover {
    background: #f3e5f5;
}

.ai-analyze-btn:active {
    background: #e1bee7;
}

.thread-reminder-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.thread-reminder-btn svg {
    width: 20px;
    height: 20px;
    color: #5f6368;
}

.thread-reminder-btn:hover {
    background: #e0e0e0;
}

.thread-reminder-menu {
    position: absolute;
    z-index: 1200;
    min-width: 170px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.thread-reminder-menu button {
    border: 1px solid transparent;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.thread-reminder-menu button:hover {
    border-color: #e9d5ff;
    background: #faf5ff;
    color: #6d28d9;
}

.thread-reminder-type-note {
    margin-bottom: 10px;
    font-size: 12px;
    color: #5f6368;
}

.thread-reminder-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.thread-reminder-actions .btn-action,
.thread-reminder-actions .mail-compose-btn {
    margin-top: 0;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.email-send-warning-modal-content {
    max-width: 560px;
}

.email-send-progress-modal-content {
    width: min(360px, calc(100vw - 32px));
    max-width: 360px;
}

.email-send-progress-modal-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
}

.email-send-progress-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    flex: 0 0 auto;
    animation: email-send-progress-spin 0.85s linear infinite;
}

.email-send-progress-message {
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

@keyframes email-send-progress-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.email-send-warning-modal-body {
    display: grid;
    gap: 16px;
}

.email-send-warning-intro,
.email-send-warning-note,
.email-send-warning-copy {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
}

.email-send-warning-section {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fafc;
}

.email-send-warning-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.email-send-warning-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.email-send-warning-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.email-send-warning-recipient {
    color: #111827;
    font-weight: 500;
    word-break: break-word;
}

.email-send-warning-band {
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.email-send-warning-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.email-send-warning-actions .btn-action,
.email-send-warning-actions .mail-compose-btn {
    margin-top: 0;
    min-height: 36px;
}

.ai-analysis-result {
    padding: 16px;
}

.ai-section {
    margin-bottom: 20px;
}

.ai-section:last-child {
    margin-bottom: 0;
}

.ai-section strong {
    display: block;
    margin-bottom: 8px;
    color: #673ab7;
    font-size: 13px;
}

.ai-section p {
    margin: 0;
    font-size: 13px;
    color: #202124;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ai-markdown {
    font-size: 13px;
    color: #202124;
    line-height: 1.6;
}

.ai-markdown > :first-child {
    margin-top: 0;
}

.ai-markdown > :last-child {
    margin-bottom: 0;
}

.ai-markdown p,
.ai-markdown ul,
.ai-markdown ol,
.ai-markdown blockquote,
.ai-markdown pre {
    margin: 0 0 12px;
}

.ai-markdown ul,
.ai-markdown ol {
    padding-left: 20px;
}

.ai-markdown li + li {
    margin-top: 4px;
}

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3,
.ai-markdown h4 {
    margin: 0 0 10px;
    color: #202124;
    line-height: 1.35;
}

.ai-markdown h1 {
    font-size: 18px;
}

.ai-markdown h2 {
    font-size: 16px;
}

.ai-markdown h3,
.ai-markdown h4 {
    font-size: 14px;
}

.ai-markdown blockquote {
    border-left: 3px solid #d2e3fc;
    padding-left: 12px;
    color: #5f6368;
}

.ai-markdown code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f1f3f4;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 12px;
}

.ai-markdown pre {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
}

.ai-markdown pre code {
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 12px;
}

.ai-markdown a {
    color: #1a73e8;
    text-decoration: underline;
}

.conversation-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.conversation-close svg {
    width: 20px;
    height: 20px;
    color: #5f6368;
}

.conversation-close:hover {
    background: #e0e0e0;
}

.conversation-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.conversation-left {
    width: 60%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-divider {
    width: 4px;
    background: #e0e0e0;
    cursor: col-resize;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.conversation-divider:hover {
    background: #9333ea;
}

.conversation-right {
    width: 40%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9fa;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversation-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    animation: slideIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-received {
    background: #f1f3f4;
}

.message-sent {
    background: #e3f2fd;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.message-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.message-forward-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.message-download-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    border-radius: 999px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.message-download-btn:hover {
    border-color: #9333ea;
    color: #9333ea;
}

.message-forward-btn:hover {
    border-color: #9333ea;
    color: #9333ea;
}

.message-from {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
}

.message-time {
    font-size: 11px;
    color: #5f6368;
    white-space: nowrap;
}

.message-to,
.message-cc {
    font-size: 11px;
    color: #5f6368;
}

.message-preview {
    font-size: 13px;
    color: #202124;
    line-height: 1.5;
}

.message-attachments-top {
    margin-top: 8px;
}

.message-attachments-toggle {
    font-size: 12px;
    color: #0f766e;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    cursor: pointer;
}

.message-attachments-toggle:hover {
    background: rgba(15, 118, 110, 0.14);
}

.message-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #5f6368;
    padding: 8px 0;
}

.message-loading .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #673ab7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.message-body-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.message-body-iframe {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    border: none;
    background: white;
    border-radius: 6px;
}

.message-body-text {
    font-size: 13px;
    color: #202124;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    padding: 12px;
    background: white;
    border-radius: 6px;
}

.message-invitation-container {
    border-top-color: rgba(124, 58, 237, 0.25);
}

.message-invitation-card {
    padding: 12px;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    border-radius: 8px;
}

.message-invitation-title {
    font-size: 14px;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 8px;
}

.message-invitation-meta {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
}

.message-invitation-attendees {
    margin: 6px 0 0;
    padding-left: 18px;
}

.message-invitation-attendee {
    margin: 2px 0;
}

.message-invitation-more {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
}

.message-invitation-description {
    margin-top: 4px;
    white-space: pre-wrap;
}

.message-attachments-list {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.message-attachments-title {
    font-size: 12px;
    color: #0f766e;
    font-weight: 600;
    margin-bottom: 6px;
}

.message-attachment-item {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
    padding: 2px 0;
    word-break: break-word;
}

.ai-summary-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ai-summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.ai-summary-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-summary-text {
    font-size: 13px;
    color: #202124;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.ai-summary-empty {
    font-size: 13px;
    color: #5f6368;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 40px 20px;
}

@media (max-width: 768px) {
    .conversation-panel {
        height: 60vh;
    }
    
    .conversation-content {
        flex-direction: column;
    }
    
    .conversation-left,
    .conversation-right {
        width: 100% !important;
    }
    
    .conversation-left {
        height: 60%;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .conversation-right {
        height: 40%;
    }
    
    .conversation-divider {
        display: none;
    }
    
    .conversation-message {
        max-width: 85%;
    }
    
    .conversation-title h3 {
        font-size: 14px;
    }
}

.workflows-topbar {
    margin-bottom: 20px;
}

.workflow-form-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.workflow-form-group {
    min-width: 280px;
    flex: 1;
    margin-bottom: 0;
}

.workflow-help-text {
    margin-top: 10px;
    color: #5f6368;
    font-size: 13px;
}

.workflow-message {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
}

.workflow-message.success {
    color: #059669;
}

.workflow-message.error {
    color: #dc2626;
}

.settings-persona-layout {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: 16px;
    align-items: start;
}

.settings-persona-summary {
    min-height: 108px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.settings-persona-summary-title {
    display: block;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.settings-persona-summary-text {
    margin: 0 0 8px;
    color: #374151;
    line-height: 1.45;
}

.settings-persona-summary-highlights {
    margin: 0;
    padding-left: 18px;
    color: #4b5563;
}

.signature-manager-help {
    margin: 0 0 14px;
    color: #5f6368;
    font-size: 13px;
    line-height: 1.5;
}

.signature-manager-warning {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
}

.signature-manager-warning a {
    color: inherit;
    font-weight: 700;
}

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

.signature-manager-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
    padding: 16px;
}

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

.signature-manager-email {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.signature-manager-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.signature-manager-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.signature-manager-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0f4c81;
    font-size: 11px;
    font-weight: 700;
}

.signature-manager-badge.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.signature-manager-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.signature-manager-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.signature-manager-tool:hover,
.signature-manager-tool.active {
    border-color: #8b5cf6;
    color: #7c3aed;
    background: #f5f3ff;
}

.signature-manager-tool-underline {
    text-decoration: underline;
}

.signature-manager-editor-wrap {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: start;
}

.signature-manager-editor-panel,
.signature-manager-preview-panel {
    display: grid;
    gap: 10px;
}

.signature-manager-pane-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.signature-manager-editor {
    min-height: 140px;
    width: 100%;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    padding: 12px 14px;
    overflow: auto;
}

.signature-manager-preview-frame {
    min-height: 140px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.signature-manager-preview {
    min-height: 140px;
    padding: 14px 16px;
    color: #111827;
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
}

.signature-manager-preview-empty {
    color: #94a3b8;
    font-style: italic;
}

.signature-manager-editor:focus,
.signature-manager-source:focus {
    outline: 2px solid rgba(139, 92, 246, 0.25);
    outline-offset: 2px;
    border-color: #8b5cf6;
}

.signature-manager-source {
    min-height: 170px;
    width: 100%;
    resize: vertical;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    padding: 12px 14px;
}

.signature-manager-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.signature-manager-empty {
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: #6b7280;
    font-size: 14px;
    background: #f8fafc;
}

@media (max-width: 900px) {
    .signature-manager-editor-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .settings-persona-layout {
        grid-template-columns: 1fr;
    }
}

.workflows-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: start;
}

.workflow-palette {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workflow-palette h4 {
    margin: 0;
    font-size: 13px;
    color: #374151;
}

.workflow-palette-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 10px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-block:active {
    cursor: grabbing;
}

.workflow-block span {
    font-size: 12px;
    color: #6b7280;
}

.workflow-canvas {
    min-height: 380px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 12px;
    background: #fafafa;
}

.workflow-empty {
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    padding: 24px 10px;
}

.workflow-step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workflow-step {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
}

.workflow-step-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.workflow-step-header span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.workflow-step-buttons {
    display: flex;
    gap: 6px;
}

.workflow-step-buttons button {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.workflow-step-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.workflow-step-config {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.workflow-step-config-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-step-config-row label {
    font-size: 12px;
    color: #374151;
}

.workflow-step-config-row input,
.workflow-step-config-row select,
.workflow-step-config-row textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 13px;
    font-family: inherit;
}

.workflow-step-config-row textarea {
    min-height: 96px;
    resize: vertical;
}

.saved-workflows-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-workflow-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.saved-workflow-details {
    flex: 1;
    min-width: 0;
}

.saved-workflow-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.saved-workflow-item span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}

.saved-workflow-hit-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.saved-workflow-actions {
    position: relative;
}

.saved-workflow-menu-trigger {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.saved-workflow-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 6px;
    display: none;
    z-index: 5;
}

.saved-workflow-menu.active {
    display: block;
}

.saved-workflow-menu button {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 7px 8px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
}

.saved-workflow-menu button:hover {
    background: #f3f4f6;
}

.notifications-table-wrap {
    overflow-x: auto;
}

.notifications-table td {
    vertical-align: top;
}

.attention-meter-topbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 18px;
    padding-bottom: 18px;
    margin-bottom: 30px;
}

.attention-meter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.attention-meter-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.attention-meter-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attention-rank-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.attention-rank-select-label {
    white-space: nowrap;
}

.attention-rank-select {
    min-width: 196px;
    height: 38px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    padding: 0 38px 0 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.attention-rank-select:focus {
    outline: none;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.attention-filter-btn,
.attention-expand-btn {
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.attention-filter-btn:hover,
.attention-expand-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #312e81;
}

.attention-filter-btn.active {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
}

.attention-expand-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border-color: transparent;
    background: transparent;
    color: #64748b;
}

.attention-expand-btn svg {
    width: 17px;
    height: 17px;
    transition: transform 0.18s ease;
}

.attention-expand-btn:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0f172a;
}

.attention-expand-btn.expanded svg {
    transform: rotate(180deg);
}

.attention-refresh-btn {
    margin-top: 0;
}

.attention-meter-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attention-summary-pill,
.attention-band-pill,
.attention-driver-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.attention-summary-pill,
.attention-band-pill {
    padding: 8px 12px;
}

.attention-driver-chip {
    padding: 6px 10px;
    background: #eef2ff;
    color: #4338ca;
}

.attention-driver-chip.muted {
    background: #f1f5f9;
    color: #64748b;
}

.attention-summary-pill.immediate,
.attention-band-pill.immediate {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.attention-summary-pill.moderate,
.attention-band-pill.moderate {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
}

.attention-summary-pill.patient,
.attention-band-pill.patient {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.attention-meter-table-wrap {
    overflow-x: auto;
}

.attention-meter-table {
    min-width: 980px;
}

.attention-meter-table th,
.attention-meter-table thead th {
    padding: 10px 14px;
}

.attention-meter-table td {
    padding: 15px 18px;
}

.attention-summary-row.expanded {
    background: rgba(248, 250, 252, 0.85);
}

.attention-sender-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attention-sender-cell strong {
    color: #0f172a;
}

.attention-sender-cell span,
.attention-detail-subtitle,
.attention-detail-footnote,
.attention-detail-metric-label {
    color: #64748b;
    font-size: 12px;
}

.attention-driver-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attention-detail-row td {
    padding: 0;
    background: #fff7ed;
}

.attention-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px 20px;
}

.attention-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.attention-detail-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.attention-detail-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.attention-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.attention-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.attention-detail-metric {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(251, 146, 60, 0.18);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attention-detail-metric strong {
    font-size: 16px;
    color: #0f172a;
}

.attention-detail-metric-wide {
    grid-column: span 4;
}

.attention-chart-shell {
    position: relative;
    min-height: 300px;
    padding: 12px 16px 8px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.9));
    border: 1px solid rgba(251, 146, 60, 0.16);
}

.attention-breakdown-btn {
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 50%;
}

.attention-breakdown-btn.is-loading {
    opacity: 0.55;
    cursor: wait;
}

.attention-bot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    user-select: none;
}

.attention-bot-toggle-label {
    min-width: 38px;
    text-align: center;
}

.attention-bot-toggle.is-human .attention-bot-toggle-label:first-child,
.attention-bot-toggle.is-bot .attention-bot-toggle-label:last-child {
    color: #0f172a;
}

.attention-bot-toggle.is-saving {
    opacity: 0.65;
}

.attention-bot-toggle-switch {
    position: relative;
    display: inline-flex;
}

.attention-bot-toggle-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.attention-bot-toggle-slider {
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.45);
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}

.attention-bot-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease;
}

.attention-bot-toggle-input:checked + .attention-bot-toggle-slider {
    background: linear-gradient(135deg, #fb923c, #f97316);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.22);
}

.attention-bot-toggle-input:checked + .attention-bot-toggle-slider::after {
    transform: translateX(20px);
}

.attention-bot-toggle-input:focus-visible + .attention-bot-toggle-slider {
    outline: 2px solid rgba(79, 70, 229, 0.35);
    outline-offset: 2px;
}

.attention-breakdown-frame {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.14);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(238, 242, 255, 0.88));
}

.attention-breakdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.attention-breakdown-title {
    font-size: 14px;
    font-weight: 700;
    color: #312e81;
}

.attention-breakdown-updated,
.attention-breakdown-recommendation,
.attention-breakdown-empty {
    font-size: 12px;
    color: #64748b;
}

.attention-breakdown-body {
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
}

.attention-breakdown-body > :first-child {
    margin-top: 0;
}

.attention-breakdown-body > :last-child {
    margin-bottom: 0;
}

.attention-breakdown-body p,
.attention-breakdown-body ul,
.attention-breakdown-body ol,
.attention-breakdown-body blockquote,
.attention-breakdown-body pre,
.attention-breakdown-body h1,
.attention-breakdown-body h2,
.attention-breakdown-body h3,
.attention-breakdown-body h4 {
    margin: 0 0 10px;
}

.attention-breakdown-body ul,
.attention-breakdown-body ol {
    padding-left: 22px;
}

.attention-breakdown-body li + li {
    margin-top: 4px;
}

.attention-breakdown-body a {
    color: #4338ca;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.attention-breakdown-body strong {
    font-weight: 700;
}

.attention-breakdown-body code {
    font-family: 'Consolas', 'SFMono-Regular', monospace;
    font-size: 0.92em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(79, 70, 229, 0.1);
    color: #312e81;
}

.attention-breakdown-body pre {
    overflow-x: auto;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.05);
}

.attention-breakdown-body pre code {
    display: block;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
}

.attention-breakdown-body blockquote {
    padding-left: 14px;
    border-left: 3px solid rgba(79, 70, 229, 0.25);
    color: #475569;
}

.attention-breakdown-body h1,
.attention-breakdown-body h2,
.attention-breakdown-body h3,
.attention-breakdown-body h4 {
    line-height: 1.35;
    color: #0f172a;
}

.attention-breakdown-body h1 {
    font-size: 1.2em;
}

.attention-breakdown-body h2 {
    font-size: 1.1em;
}

.attention-breakdown-body h3,
.attention-breakdown-body h4 {
    font-size: 1em;
}

.attention-breakdown-recommendation {
    padding-top: 2px;
    color: #b45309;
    font-weight: 600;
}

.attention-detail-footnote {
    margin-top: -4px;
}

@media (max-width: 960px) {
    .attention-meter-actions {
        align-items: stretch;
    }

    .attention-detail-header-meta {
        align-items: flex-start;
    }

    .attention-refresh-btn {
        width: 100%;
    }

    .attention-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .attention-detail-metric-wide {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .attention-detail-panel {
        padding: 16px;
    }

    .attention-detail-metrics {
        grid-template-columns: 1fr;
    }

    .attention-detail-metric-wide {
        grid-column: span 1;
    }

    .attention-chart-shell {
        min-height: 200px;
        padding: 10px 12px 6px;
    }
}

.notifications-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 8px;
}

.notifications-actions-cell .btn-action {
    padding: 8px 12px;
    min-width: 70px;
}

.slack-webhook-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.slack-webhook-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.slack-webhook-grid th,
.slack-webhook-grid td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}

.slack-webhook-grid th {
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
    background: #f9fafb;
}

.slack-webhook-grid td input {
    width: 100%;
    margin-top: 0;
}

.slack-webhook-grid td select,
.slack-webhook-grid td textarea {
    width: 100%;
    margin-top: 0;
}

.slack-webhook-grid td textarea {
    min-height: 84px;
    resize: vertical;
}

.slack-webhook-grid-actions {
    margin-top: 10px;
}

.slack-webhook-grid-actions-cell {
    width: 120px;
}

.slack-webhook-grid-empty {
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

.settings-alert-help {
    color: #5f6368;
    display: block;
    margin-top: 4px;
}

html.theme-dark .settings-section-toggle {
    background: transparent;
}

html.theme-dark .settings-section-title {
    color: var(--dark-text-primary);
}

html.theme-dark .settings-section-chevron {
    border-right-color: var(--dark-text-secondary);
    border-bottom-color: var(--dark-text-secondary);
}

@media (max-width: 1200px) {
    .workflows-grid {
        grid-template-columns: 1fr;
    }
}

/* Theme Toggle */
.theme-menu-item {
    cursor: default;
    align-items: center;
}

.theme-menu-item svg {
    stroke: #6366f1;
    flex-shrink: 0;
}

.theme-menu-content {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.theme-menu-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.theme-menu-subtitle {
    font-size: 11px;
    color: #6b7280;
}

.theme-toggle-control {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle-mode-label {
    min-width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.theme-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-flex;
    align-items: center;
}

.theme-toggle-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.theme-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.2s ease;
}

.theme-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.theme-toggle-input:checked + .theme-toggle-slider {
    background: #8b5cf6;
}

.theme-toggle-input:checked + .theme-toggle-slider::after {
    transform: translateX(20px);
}

.theme-toggle-input:focus-visible + .theme-toggle-slider {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Dark Theme: content pages and overlays only */
html.theme-dark {
    --dark-content-bg: #0b1220;
    --dark-surface-1: #111827;
    --dark-surface-2: #162133;
    --dark-surface-3: #1b2a3d;
    --dark-surface-4: #22324a;
    --dark-border: #2a3b52;
    --dark-border-strong: #3b506d;
    --dark-text-primary: #e5edf7;
    --dark-text-secondary: #a8b6ca;
    --dark-text-muted: #8b9ab0;
    --dark-accent-soft: rgba(139, 92, 246, 0.16);
    --dark-accent-border: rgba(167, 139, 250, 0.38);
    --dark-success-soft: rgba(16, 185, 129, 0.14);
    --dark-success-border: rgba(52, 211, 153, 0.32);
    --dark-warning-soft: rgba(245, 158, 11, 0.14);
    --dark-warning-border: rgba(251, 191, 36, 0.3);
    --dark-danger-soft: rgba(239, 68, 68, 0.14);
    --dark-danger-border: rgba(248, 113, 113, 0.3);
    --dark-shadow: 0 20px 40px rgba(2, 8, 23, 0.38);
}

html.theme-dark .dashboard-content,
html.theme-dark .modal-content,
html.theme-dark .conversation-panel,
html.theme-dark .user-menu {
    color-scheme: dark;
}

html.theme-dark .dashboard-content {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28%),
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.1), transparent 24%),
        linear-gradient(180deg, #0f1726 0%, var(--dark-content-bg) 45%, #09101b 100%);
    color: var(--dark-text-primary);
}

html.theme-dark .dashboard-content::-webkit-scrollbar-track {
    background: #152033;
}

html.theme-dark .dashboard-content::-webkit-scrollbar-thumb {
    background: #42556f;
}

html.theme-dark .dashboard-content::-webkit-scrollbar-thumb:hover {
    background: #576e8f;
}

html.theme-dark .dashboard-card,
html.theme-dark .stat-card,
html.theme-dark .chart-card,
html.theme-dark .audit-grid-wrap,
html.theme-dark .mail-list-container,
html.theme-dark .list-item,
html.theme-dark .kanban-column,
html.theme-dark .kanban-card,
html.theme-dark .eisenhower-matrix,
html.theme-dark .eisenhower-card,
html.theme-dark .analysis-rule-row,
html.theme-dark .workflow-block,
html.theme-dark .workflow-canvas,
html.theme-dark .workflow-step,
html.theme-dark .saved-workflow-item,
html.theme-dark .slack-webhook-grid-wrapper,
html.theme-dark .calendar-day-cell,
html.theme-dark .calendar-day-empty,
html.theme-dark .calendar-event-card,
html.theme-dark .calendar-line-summary,
html.theme-dark .calendar-ai-section-card,
html.theme-dark .calendar-ai-item,
html.theme-dark .ai-agent-table-wrap,
html.theme-dark .ai-verified-table-wrap,
html.theme-dark .ai-chat-container,
html.theme-dark .message-body-text,
html.theme-dark .message-attachments-list,
html.theme-dark .thread-reminder-menu,
html.theme-dark .rule-context-menu,
html.theme-dark .saved-workflow-menu,
html.theme-dark .modal-content,
html.theme-dark .conversation-panel,
html.theme-dark .conversation-right,
html.theme-dark .mail-recipient-chip,
html.theme-dark .calendar-attendee-chip,
html.theme-dark .calendar-ai-source-badge,
html.theme-dark .message-invitation-card {
    background: var(--dark-surface-1);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
    box-shadow: var(--dark-shadow);
}

html.theme-dark .conversation-top-resize-handle::before {
    background: rgba(148, 163, 184, 0.45);
}

html.theme-dark .conversation-top-resize-handle:hover::before,
html.theme-dark .conversation-top-resize-handle.is-dragging::before {
    background: rgba(167, 139, 250, 0.8);
}

html.theme-dark .workflow-canvas,
html.theme-dark .kanban-column,
html.theme-dark .eisenhower-quadrant,
html.theme-dark .ai-chat-container,
html.theme-dark .conversation-right,
html.theme-dark .workflow-block span,
html.theme-dark .saved-workflow-item span,
html.theme-dark .calendar-line-summary,
html.theme-dark .calendar-ai-section-card,
html.theme-dark .calendar-day-empty {
    background: var(--dark-surface-2);
}

html.theme-dark .dashboard-card,
html.theme-dark .stat-card,
html.theme-dark .chart-card,
html.theme-dark .modal-content,
html.theme-dark .conversation-panel,
html.theme-dark .mail-list-container,
html.theme-dark .audit-grid-wrap,
html.theme-dark .slack-webhook-grid-wrapper {
    border: 1px solid var(--dark-border);
}

html.theme-dark .stat-card:hover,
html.theme-dark .kanban-card:hover,
html.theme-dark .eisenhower-card:hover,
html.theme-dark .list-item:hover,
html.theme-dark .analysis-rule-row:hover,
html.theme-dark .workflow-block:hover,
html.theme-dark .saved-workflow-item:hover {
    box-shadow: 0 22px 40px rgba(2, 8, 23, 0.46);
    border-color: var(--dark-border-strong);
}

html.theme-dark .page-title,
html.theme-dark .dashboard-card h2,
html.theme-dark .dashboard-content h3,
html.theme-dark .dashboard-content h4,
html.theme-dark .dashboard-content h5,
html.theme-dark .stat-value,
html.theme-dark .stat-main-number,
html.theme-dark .stat-metric-value,
html.theme-dark .saved-time-number,
html.theme-dark .activity-source-value,
html.theme-dark .chart-value,
html.theme-dark .rule-text,
html.theme-dark .kanban-card-subject,
html.theme-dark .mail-item-from,
html.theme-dark .mailbox-score-gauge-value span,
html.theme-dark .calendar-panel-title,
html.theme-dark .calendar-event-title,
html.theme-dark .ai-verified-title,
html.theme-dark .message-from,
html.theme-dark .conversation-title h3,
html.theme-dark .modal-header h3,
html.theme-dark .audit-kv-value,
html.theme-dark .theme-menu-title {
    color: var(--dark-text-primary);
}

html.theme-dark .calendar-panel-title,
html.theme-dark .calendar-weekday {
    color: #ffffff;
}

html.theme-dark .calendar-day-number {
    color: var(--dark-text-primary);
}

html.theme-dark .page-subtitle,
html.theme-dark .stat-title,
html.theme-dark .stat-change-label,
html.theme-dark .stat-metric-label,
html.theme-dark .saved-time-labels,
html.theme-dark .activity-source-label,
html.theme-dark .chart-title,
html.theme-dark .chart-change-label,
html.theme-dark .form-group label,
html.theme-dark .mail-item-subject,
html.theme-dark .mail-item-summary,
html.theme-dark .mail-item-date,
html.theme-dark .mail-item-deadline,
html.theme-dark .pagination-info,
html.theme-dark .workflow-help-text,
html.theme-dark .workflow-empty,
html.theme-dark .rule-description,
html.theme-dark .audit-field label,
html.theme-dark .audit-kv-key,
html.theme-dark .audit-kv-empty,
html.theme-dark .audit-empty,
html.theme-dark .calendar-day-count,
html.theme-dark .calendar-event-meta,
html.theme-dark .calendar-event-content {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-item.unread .mail-item-subject {
    color: var(--dark-text-primary);
}

html.theme-dark .calendar-attendee-name,
html.theme-dark .calendar-attendees-more,
html.theme-dark .calendar-ai-summary,
html.theme-dark .calendar-ai-empty,
html.theme-dark .calendar-ai-item-meta,
html.theme-dark .ai-agent-sources-title,
html.theme-dark .ai-agent-table th,
html.theme-dark .ai-verified-empty,
html.theme-dark .message-time,
html.theme-dark .message-to,
html.theme-dark .message-cc,
html.theme-dark .mail-compose-hint,
html.theme-dark .theme-menu-subtitle,
html.theme-dark .theme-toggle-mode-label {
    color: var(--dark-text-secondary);
}

html.theme-dark .audit-grid th,
html.theme-dark .ai-agent-table th,
html.theme-dark .ai-verified-table th,
html.theme-dark .slack-webhook-grid th,
html.theme-dark .attention-meter-table th {
    background: var(--dark-surface-3);
    color: var(--dark-text-secondary);
    border-bottom-color: var(--dark-border);
}

html.theme-dark .audit-grid td,
html.theme-dark .ai-agent-table td,
html.theme-dark .ai-verified-table td,
html.theme-dark .slack-webhook-grid td,
html.theme-dark .notifications-table td,
html.theme-dark .attention-meter-table td,
html.theme-dark .mail-item,
html.theme-dark .message-attachment-item,
html.theme-dark .message-body-container {
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

html.theme-dark .attention-filter-btn,
html.theme-dark .attention-expand-btn,
html.theme-dark .attention-driver-chip.muted {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-expand-btn {
    background: transparent;
    border-color: transparent;
}

html.theme-dark .attention-filter-btn:hover,
html.theme-dark .attention-expand-btn:hover {
    background: var(--dark-surface-3);
    border-color: var(--dark-border-strong);
    color: var(--dark-text-primary);
}

html.theme-dark .attention-filter-btn.active {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    border-color: transparent;
}

html.theme-dark .attention-summary-row.expanded {
    background: rgba(15, 23, 42, 0.42);
}

html.theme-dark .attention-detail-row td {
    background: rgba(124, 45, 18, 0.16);
}

html.theme-dark .attention-detail-panel {
    background: transparent;
}

html.theme-dark .attention-detail-title,
html.theme-dark .attention-sender-cell strong,
html.theme-dark .attention-detail-metric strong {
    color: var(--dark-text-primary);
}

html.theme-dark .attention-sender-cell span,
html.theme-dark .attention-detail-subtitle,
html.theme-dark .attention-detail-footnote,
html.theme-dark .attention-detail-metric-label {
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-detail-metric {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(249, 115, 22, 0.22);
}

html.theme-dark .attention-chart-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
    border-color: rgba(249, 115, 22, 0.22);
}

html.theme-dark .attention-breakdown-frame {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88));
    border-color: rgba(129, 140, 248, 0.22);
}

html.theme-dark .attention-breakdown-title {
    color: #c7d2fe;
}

html.theme-dark .attention-rank-select-wrap {
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-rank-select {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--dark-text-primary);
    box-shadow: none;
}

html.theme-dark .attention-rank-select:focus {
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

html.theme-dark .attention-bot-toggle {
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-bot-toggle.is-human .attention-bot-toggle-label:first-child,
html.theme-dark .attention-bot-toggle.is-bot .attention-bot-toggle-label:last-child {
    color: #f8fafc;
}

html.theme-dark .attention-bot-toggle-slider {
    background: #334155;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
}

html.theme-dark .attention-bot-toggle-slider::after {
    background: #e2e8f0;
}

html.theme-dark .attention-bot-toggle-input:checked + .attention-bot-toggle-slider {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.24);
}

html.theme-dark .attention-breakdown-body {
    color: var(--dark-text-primary);
}

html.theme-dark .attention-breakdown-body a {
    color: #a5b4fc;
}

html.theme-dark .attention-breakdown-body code {
    background: rgba(129, 140, 248, 0.16);
    color: #c7d2fe;
}

html.theme-dark .attention-breakdown-body pre {
    background: rgba(15, 23, 42, 0.58);
}

html.theme-dark .attention-breakdown-body blockquote {
    border-left-color: rgba(129, 140, 248, 0.35);
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-breakdown-body h1,
html.theme-dark .attention-breakdown-body h2,
html.theme-dark .attention-breakdown-body h3,
html.theme-dark .attention-breakdown-body h4 {
    color: #e2e8f0;
}

html.theme-dark .attention-breakdown-updated,
html.theme-dark .attention-breakdown-empty {
    color: var(--dark-text-secondary);
}

html.theme-dark .attention-breakdown-recommendation {
    color: #fdba74;
}

html.theme-dark .attention-driver-chip {
    background: rgba(67, 56, 202, 0.22);
    color: #c7d2fe;
}

html.theme-dark .attention-summary-pill.immediate,
html.theme-dark .attention-band-pill.immediate {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

html.theme-dark .attention-summary-pill.moderate,
html.theme-dark .attention-band-pill.moderate {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

html.theme-dark .attention-summary-pill.patient,
html.theme-dark .attention-band-pill.patient {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
}

html.theme-dark .audit-kv-group,
html.theme-dark .mail-item-count,
html.theme-dark .mail-item-attachments,
html.theme-dark .kanban-card-messages,
html.theme-dark .kanban-card-attachments,
html.theme-dark .settings-persona-summary,
html.theme-dark .signature-manager-card,
html.theme-dark .signature-manager-empty,
html.theme-dark .calendar-event-link,
html.theme-dark .message-download-btn,
html.theme-dark .message-forward-btn,
html.theme-dark .mail-compose-btn,
html.theme-dark .mail-compose-trigger,
html.theme-dark .mail-quick-filters-toggle,
html.theme-dark .saved-workflow-menu-trigger,
html.theme-dark .chart-filter-btn,
html.theme-dark .chart-nav-btn,
html.theme-dark .pagination-btn,
html.theme-dark .mail-quick-filter,
html.theme-dark .workflow-step-buttons button,
html.theme-dark .thread-reminder-menu button,
html.theme-dark .mail-search-btn.secondary,
html.theme-dark .user-menu,
html.theme-dark .user-menu-item,
html.theme-dark .conversation-count,
html.theme-dark .message-attachments-toggle {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

html.theme-dark .user-menu-item:hover,
html.theme-dark .chart-filter-btn:hover,
html.theme-dark .chart-nav-btn:hover:not(:disabled),
html.theme-dark .pagination-btn:hover:not(:disabled),
html.theme-dark .mail-compose-btn:hover,
html.theme-dark .mail-compose-trigger:hover,
html.theme-dark .action-priority-pill:hover,
html.theme-dark .workflow-step-buttons button:hover,
html.theme-dark .thread-reminder-menu button:hover,
html.theme-dark .saved-workflow-menu-trigger:hover,
html.theme-dark .message-download-btn:hover,
html.theme-dark .message-forward-btn:hover,
html.theme-dark .rule-menu-button:hover {
    background: var(--dark-surface-3);
    border-color: var(--dark-border-strong);
    color: var(--dark-text-primary);
}

html.theme-dark .saved-workflow-hit-pill {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

html.theme-dark .chart-filter-btn.active {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.45);
}

html.theme-dark .chart-day-label {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-quick-filter,
html.theme-dark .mail-tab,
html.theme-dark .kanban-archived-toggle,
html.theme-dark .kanban-sort-label,
html.theme-dark .calendar-rsvp-select-label,
html.theme-dark .message-preview,
html.theme-dark .ai-summary-text,
html.theme-dark .ai-agent-paragraph,
html.theme-dark .ai-agent-list,
html.theme-dark .calendar-ai-list,
html.theme-dark .calendar-ai-paragraph,
html.theme-dark .ai-markdown,
html.theme-dark .ai-section p,
html.theme-dark .ai-section strong,
html.theme-dark .mail-search-status,
html.theme-dark .mail-empty,
html.theme-dark .mail-error,
html.theme-dark .conversation-close svg,
html.theme-dark .sort-btn svg,
html.theme-dark .ai-analyze-btn svg,
html.theme-dark .thread-reminder-btn svg {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-tab:hover,
html.theme-dark .mail-quick-filter:hover,
html.theme-dark .mail-quick-filters-toggle:hover,
html.theme-dark .sort-btn:hover,
html.theme-dark .thread-reminder-btn:hover,
html.theme-dark .conversation-close:hover,
html.theme-dark .ai-analyze-btn:hover {
    background: var(--dark-surface-2);
}

html.theme-dark .mail-tab.active,
html.theme-dark .mail-quick-filter.active {
    color: #ede9fe;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
}

html.theme-dark .email-send-warning-intro,
html.theme-dark .email-send-warning-note,
html.theme-dark .email-send-warning-copy {
    color: var(--dark-text-secondary);
}

html.theme-dark .email-send-warning-section,
html.theme-dark .email-send-warning-list li {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
}

html.theme-dark .email-send-warning-title,
html.theme-dark .email-send-warning-recipient {
    color: var(--dark-text-primary);
}

html.theme-dark .email-send-warning-band {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

html.theme-dark .mail-item:hover,
html.theme-dark #page-action-center #actionCenterList .list-item:hover {
    background: rgba(148, 163, 184, 0.08);
}

html.theme-dark .mail-item.selected {
    border-left-color: #f87171;
    background: rgba(127, 29, 29, 0.28);
}

html.theme-dark .mail-search-input,
html.theme-dark .mail-recipient-editor,
html.theme-dark .mail-compose-editor,
html.theme-dark .dashboard-content input:not([type="checkbox"]):not([type="radio"]),
html.theme-dark .dashboard-content textarea,
html.theme-dark .dashboard-content select,
html.theme-dark .modal-content input:not([type="checkbox"]):not([type="radio"]),
html.theme-dark .modal-content textarea,
html.theme-dark .modal-content select,
html.theme-dark .calendar-viz-select,
html.theme-dark .calendar-rsvp-select,
html.theme-dark .mail-item-status,
html.theme-dark .mail-recipient-input,
html.theme-dark .slack-webhook-grid td input,
html.theme-dark .slack-webhook-grid td select,
html.theme-dark .slack-webhook-grid td textarea {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

html.theme-dark .mail-compose-ai-panel {
    border-color: var(--dark-border);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.98) 100%);
}

html.theme-dark .mail-compose-footer {
    background: var(--dark-surface-1);
    border-top-color: var(--dark-border);
}

html.theme-dark .mail-compose-ai-panel-header,
html.theme-dark .mail-compose-ai-draft-preview {
    border-color: var(--dark-border);
}

html.theme-dark .mail-compose-ai-action,
html.theme-dark .mail-compose-ai-draft-preview {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

html.theme-dark .mail-compose-ai-status,
html.theme-dark .mail-compose-ai-action span,
html.theme-dark .mail-compose-ai-empty,
html.theme-dark .mail-compose-ai-loading,
html.theme-dark .mail-compose-ai-review-section ul {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-compose-ai-review-section strong {
    color: var(--dark-text-primary);
}

html.theme-dark .mail-compose-ai-action:hover {
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.18);
}

html.theme-dark .mail-compose-ai-error {
    color: #fca5a5;
}

html.theme-dark .mail-compose-signature {
    border-top-color: var(--dark-border);
}

html.theme-dark .mail-compose-attachments-label,
html.theme-dark .mail-compose-attachment-size {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-compose-attachment-chip {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
}

html.theme-dark .mail-compose-attachment-name {
    color: var(--dark-text-primary);
}

html.theme-dark .mail-compose-attachment-remove {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-compose-attachment-remove:hover {
    background: rgba(148, 163, 184, 0.18);
    color: var(--dark-text-primary);
}

html.theme-dark .mail-compose-top-resize-handle::before {
    background: rgba(148, 163, 184, 0.45);
}

html.theme-dark .mail-compose-top-resize-handle:hover::before,
html.theme-dark .mail-compose-top-resize-handle.is-dragging::before {
    background: rgba(167, 139, 250, 0.78);
}

html.theme-dark .settings-alert-help {
    color: var(--dark-text-secondary);
}

html.theme-dark .mail-recipient-input::placeholder,
html.theme-dark .dashboard-content input::placeholder,
html.theme-dark .dashboard-content textarea::placeholder,
html.theme-dark .modal-content input::placeholder,
html.theme-dark .modal-content textarea::placeholder {
    color: var(--dark-text-muted);
}

html.theme-dark .mail-search-input:focus,
html.theme-dark .mail-recipient-editor:focus-within,
html.theme-dark .mail-compose-editor:focus,
html.theme-dark .dashboard-content input:focus,
html.theme-dark .dashboard-content textarea:focus,
html.theme-dark .dashboard-content select:focus,
html.theme-dark .modal-content input:focus,
html.theme-dark .modal-content textarea:focus,
html.theme-dark .modal-content select:focus,
html.theme-dark .calendar-viz-select:focus,
html.theme-dark .calendar-rsvp-select:focus,
html.theme-dark .kanban-sort-select:focus {
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

html.theme-dark .email-priority-pill,
html.theme-dark .mail-item-status,
html.theme-dark .action-priority-pill {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
}

html.theme-dark .email-priority-pill.priority-high,
html.theme-dark .action-priority-pill.high {
    color: #dc2626;
}

html.theme-dark .email-priority-pill.priority-medium,
html.theme-dark .action-priority-pill.medium {
    color: #f59e0b;
}

html.theme-dark .email-priority-pill.priority-low,
html.theme-dark .action-priority-pill.low {
    color: rgb(59 130 246);
}

html.theme-dark .mail-item-status.status-todo {
    color: #fca5a5;
}

html.theme-dark .mail-item-status.status-in-progress {
    color: #fb923c;
}

html.theme-dark .mail-item-status.status-done {
    color: #93c5fd;
}

html.theme-dark .mail-item-status.status-archived {
    color: #d1d5db;
}

html.theme-dark .mail-item-status option {
    background: var(--dark-surface-2);
    color: #ffffff;
}

html.theme-dark .mail-item-status option[value="todo"] {
    color: #fca5a5;
}

html.theme-dark .mail-item-status option[value="in-progress"] {
    color: #fb923c;
}

html.theme-dark .mail-item-status option[value="done"] {
    color: #93c5fd;
}

html.theme-dark .mail-item-status option[value="archived"] {
    color: #d1d5db;
}

html.theme-dark .action-priority-pill:hover,
html.theme-dark .action-priority-pill.is-selected {
    background: var(--dark-surface-3);
}

html.theme-dark .action-priority-pill.high:hover,
html.theme-dark .action-priority-pill.high.is-selected {
    color: #dc2626;
}

html.theme-dark .action-priority-pill.medium:hover,
html.theme-dark .action-priority-pill.medium.is-selected {
    color: #f59e0b;
}

html.theme-dark .action-priority-pill.low:hover,
html.theme-dark .action-priority-pill.low.is-selected {
    color: rgb(59 130 246);
}

html.theme-dark .chart-avg-saved,
html.theme-dark .activity-source-divider,
html.theme-dark .mail-tabs,
html.theme-dark .mail-pagination,
html.theme-dark .kanban-column-header,
html.theme-dark .conversation-header,
html.theme-dark .ai-summary-title,
html.theme-dark .modal-header,
html.theme-dark .message-body-container,
html.theme-dark .ai-agent-sources,
html.theme-dark .calendar-ai-source-badge,
html.theme-dark .calendar-month-panel,
html.theme-dark .calendar-day-panel {
    border-color: var(--dark-border);
}

html.theme-dark .conversation-header,
html.theme-dark .mail-pagination,
html.theme-dark .ai-summary-title,
html.theme-dark .modal-header {
    background: var(--dark-surface-2);
}

html.theme-dark .message-received {
    background: rgba(30, 41, 59, 0.9);
}

html.theme-dark .message-sent {
    background: rgba(37, 99, 235, 0.2);
}

html.theme-dark .ai-message-assistant .ai-message-content,
html.theme-dark .message-body-text,
html.theme-dark .ai-summary-content {
    background: var(--dark-surface-2);
    color: var(--dark-text-primary);
}

html.theme-dark .message-body-iframe {
    background: #fff;
}

html.theme-dark .calendar-day-cell.heatmap {
    background: var(--calendar-heat-color, rgb(96 165 250 / 0.28));
    border-color: var(--calendar-heat-border, #60a5fa);
}

html.theme-dark .calendar-day-cell.heatmap:hover {
    border-color: var(--calendar-heat-border, #93c5fd);
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.34);
}

html.theme-dark .calendar-day-cell.selected,
html.theme-dark #page-action-center #actionCenterList .list-item.selected,
html.theme-dark .action-priority-pill.is-selected,
html.theme-dark .kanban-column-content.drag-over {
    background: var(--dark-accent-soft);
    border-color: var(--dark-accent-border);
}

html.theme-dark .kanban-card-aging,
html.theme-dark .calendar-ai-source-llm,
html.theme-dark .calendar-event-link,
html.theme-dark .ai-section strong {
    background: var(--dark-accent-soft);
    border-color: var(--dark-accent-border);
    color: #d8b4fe;
}

html.theme-dark .ai-markdown h1,
html.theme-dark .ai-markdown h2,
html.theme-dark .ai-markdown h3,
html.theme-dark .ai-markdown h4,
html.theme-dark .ai-markdown a {
    color: var(--dark-text-primary);
}

html.theme-dark .ai-markdown blockquote {
    border-left-color: rgba(138, 180, 248, 0.5);
    color: var(--dark-text-secondary);
}

html.theme-dark .ai-markdown code {
    background: rgba(255, 255, 255, 0.08);
}

html.theme-dark .ai-markdown pre {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .message.success,
html.theme-dark .workflow-message.success {
    background: var(--dark-success-soft);
    border-color: var(--dark-success-border);
    color: #86efac;
}

html.theme-dark .message.error,
html.theme-dark .workflow-message.error,
html.theme-dark .ai-error .ai-message-content {
    background: var(--dark-danger-soft);
    border-color: var(--dark-danger-border);
    color: #fca5a5;
}

html.theme-dark .calendar-attendee-rsvp-accepted {
    background: rgba(16, 185, 129, 0.18);
    color: #86efac;
}

html.theme-dark .calendar-attendee-rsvp-tentative {
    background: var(--dark-warning-soft);
    color: #fcd34d;
}

html.theme-dark .calendar-attendee-rsvp-declined {
    background: var(--dark-danger-soft);
    color: #fca5a5;
}

html.theme-dark .calendar-attendee-rsvp-needs-action {
    background: rgba(148, 163, 184, 0.16);
    color: var(--dark-text-secondary);
}

html.theme-dark .modal {
    background: rgba(2, 6, 12, 0.72);
}

html.theme-dark .email-send-progress-message {
    color: var(--dark-text-primary);
}

html.theme-dark .email-send-progress-spinner {
    border-color: #475569;
    border-top-color: #93c5fd;
}

html.theme-dark .theme-menu-title,
html.theme-dark .theme-toggle-mode-label,
html.theme-dark .settings-persona-summary-title,
html.theme-dark .signature-manager-email,
html.theme-dark .user-menu-item span {
    color: var(--dark-text-primary);
}

html.theme-dark .theme-menu-subtitle,
html.theme-dark .settings-persona-summary-text,
html.theme-dark .settings-persona-summary-highlights,
html.theme-dark .signature-manager-help,
html.theme-dark .signature-manager-meta,
html.theme-dark .signature-manager-empty,
html.theme-dark .user-menu-item svg {
    color: var(--dark-text-secondary);
    stroke: currentColor;
}

html.theme-dark .signature-manager-warning {
    border-color: #92400e;
    background: rgba(146, 64, 14, 0.18);
    color: #fdba74;
}

html.theme-dark .signature-manager-editor {
    border-color: var(--dark-border);
    background: var(--dark-surface-2);
    color: var(--dark-text-primary);
}

html.theme-dark .signature-manager-pane-title,
html.theme-dark .signature-manager-preview-empty {
    color: var(--dark-text-secondary);
}

html.theme-dark .signature-manager-preview-frame {
    border-color: var(--dark-border);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
}

html.theme-dark .signature-manager-preview {
    color: var(--dark-text-primary);
}

html.theme-dark .signature-manager-source,
html.theme-dark .signature-manager-tool {
    border-color: var(--dark-border);
    background: var(--dark-surface-2);
    color: var(--dark-text-primary);
}

html.theme-dark .signature-manager-tool:hover,
html.theme-dark .signature-manager-tool.active {
    border-color: #a78bfa;
    color: #ddd6fe;
    background: rgba(139, 92, 246, 0.18);
}

html.theme-dark .signature-manager-badge {
    background: rgba(14, 165, 233, 0.18);
    color: #bae6fd;
}

html.theme-dark .signature-manager-badge.badge-warning {
    background: rgba(217, 119, 6, 0.18);
    color: #fcd34d;
}

html.theme-dark .theme-toggle-slider {
    background: #334155;
}

html.theme-dark .theme-toggle-input:checked + .theme-toggle-slider {
    background: #8b5cf6;
}

html.theme-dark .mailbox-score-gauge-track {
    stroke: #334155;
}

html.theme-dark .mailbox-score-gauge-needle,
html.theme-dark .mailbox-score-gauge-pivot {
    background: #e5edf7;
}

html.theme-dark .mailbox-score-gauge-pivot {
    background: #e5edf7;
}
