/* ── Reset & Base ────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1923;
    --bg-secondary: #1a2734;
    --bg-card: #1e2d3d;
    --bg-input: #162230;
    --bg-hover: #243a4e;
    --border-color: #2a3f52;
    --border-light: #34506a;
    --text-primary: #e8edf2;
    --text-secondary: #8ea4b8;
    --text-muted: #5d7a92;
    --accent: #4ade80;
    --accent-hover: #22c55e;
    --accent-dim: rgba(74, 222, 128, 0.1);
    --error: #f87171;
    --error-dim: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --info: #60a5fa;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────── */
#app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    font-weight: 500;
}

/* ── Header Right & Navigation ──────────────────────────────────── */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent);
    font-weight: 600;
    border-color: rgba(74, 222, 128, 0.25);
    background: var(--accent-dim);
}

/* ── Divider ─────────────────────────────────────────────────────── */
.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 2px;
    flex-shrink: 0;
}

/* ── Utility & CTA Actions ───────────────────────────────────────── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── GitHub Star Button ──────────────────────────────────────────── */
.nav-github-star {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f1923;
    text-decoration: none;
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
    border: 1px solid #f59e0b;
    box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.4), 0 2px 8px rgba(245, 158, 11, 0.35);
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-github-star::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    pointer-events: none;
}

.nav-github-star:hover {
    color: #0f1923;
    background: linear-gradient(135deg, #fef08a 0%, #fbbf24 100%);
    box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.3), 0 4px 16px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.nav-github-star:active {
    transform: translateY(0);
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.3), 0 2px 8px rgba(245, 158, 11, 0.35);
}

.nav-github-star .star-icon {
    animation: star-pulse 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 0.85; }
}

/* ── Language Toggle ─────────────────────────────────────────────── */
.nav-lang-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 9px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.nav-lang-toggle:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.nav-lang-toggle .lang-sep {
    color: var(--text-muted);
    font-weight: 300;
}

/* Active language label — bold & bright */
.nav-lang-toggle[data-lang="vi"] .lang-vi {
    color: var(--accent);
}
.nav-lang-toggle[data-lang="vi"] .lang-en {
    color: var(--text-muted);
    font-weight: 400;
}
.nav-lang-toggle[data-lang="en"] .lang-en {
    color: var(--accent);
}
.nav-lang-toggle[data-lang="en"] .lang-vi {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Main ────────────────────────────────────────────────────────── */
#app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Input Section ───────────────────────────────────────────────── */
.input-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.limit-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.limit-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.limit-input {
    width: 70px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
    transition: border-color var(--transition);
}

.limit-input:focus {
    outline: none;
    border-color: var(--accent);
}

.textarea-wrapper {
    position: relative;
}

#oauth2-input {
    width: 100%;
    min-height: 160px;
    max-height: 400px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--transition);
}

#oauth2-input::placeholder {
    color: var(--text-muted);
}

#oauth2-input:focus {
    outline: none;
    border-color: var(--accent);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 4px;
}

#line-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-clear:hover {
    color: var(--error);
    border-color: var(--error);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent);
    color: #0f1923;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Results Section ─────────────────────────────────────────────── */
.results-section {
    animation: fadeIn 0.3s ease;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.results-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.results-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ── Account Card ────────────────────────────────────────────────── */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.account-card:hover {
    border-color: var(--border-light);
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.account-email {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--info);
    word-break: break-all;
}

.account-status {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.account-status.ok {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.account-status.error {
    background: var(--error-dim);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.account-error-msg {
    padding: 14px 20px;
    color: var(--error);
    font-size: 0.85rem;
    word-break: break-all;
}

/* ── Mail Table ──────────────────────────────────────────────────── */
.mail-table {
    width: 100%;
    border-collapse: collapse;
}

.mail-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.mail-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.mail-table tbody tr:last-child {
    border-bottom: none;
}

.mail-table tbody tr:hover {
    background: var(--bg-hover);
}

.mail-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
    vertical-align: top;
}

.mail-table .col-stt {
    width: 50px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

.mail-table .col-from {
    width: 200px;
    color: var(--text-secondary);
}

.mail-table .col-from .from-name {
    font-weight: 500;
    color: var(--text-primary);
}

.mail-table .col-from .from-addr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mail-table .col-time {
    width: 140px;
    color: #a3c4da;
    white-space: nowrap;
    font-size: 0.8rem;
}

.mail-table .col-content {
    min-width: 200px;
}

.mail-table .col-content .mail-subject {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mail-table .col-content .mail-snippet {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mail-table .col-code {
    width: 110px;
    text-align: center;
    vertical-align: middle;
}

.code-cell-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.code-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.btn-copy-code {
    display: inline-block;
    padding: 3px 12px;
    background: #ff5722;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.3;
    box-shadow: 0 2px 6px rgba(255, 87, 34, 0.35);
}

.btn-copy-code:hover {
    background: #f44336;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.45);
}

.btn-copy-code:active {
    transform: scale(0.96);
}

.btn-copy-code.copied {
    background: #22c55e !important;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4) !important;
}

.code-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.mail-table .col-action {
    width: 90px;
    text-align: center;
}

.btn-detail {
    padding: 5px 12px;
    background: transparent;
    color: var(--info);
    border: 1px solid var(--info);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-detail:hover {
    background: rgba(96, 165, 250, 0.1);
}

/* ── Xem thêm button ────────────────────────────────────────────── */
.account-footer {
    display: flex;
    justify-content: center;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-more {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-more:hover {
    background: var(--accent-dim);
}

.btn-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-more .spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: var(--error-dim);
    color: var(--error);
    border-color: var(--error);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-meta {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.modal-meta .meta-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.modal-meta .meta-label {
    color: var(--text-muted);
    min-width: 50px;
}

.modal-meta .meta-value {
    color: var(--text-primary);
    word-break: break-all;
}

#modal-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
    min-height: 400px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Loading Overlay ─────────────────────────────────────────────── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

#loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── OAuth2 Page ─────────────────────────────────────────────────── */
.oauth2-limit-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.oauth2-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.oauth2-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

#oauth2-cred-input {
    width: 100%;
    min-height: 140px;
    max-height: 320px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--transition);
}

#oauth2-cred-input::placeholder { color: var(--text-muted); }

#oauth2-cred-input:focus {
    outline: none;
    border-color: var(--info);
}

.btn-oauth2 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--info);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-oauth2:hover {
    background: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.3);
}

.btn-oauth2:active { transform: translateY(0); }

.btn-oauth2:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.oauth2-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
    animation: fadeSlideIn 0.3s ease;
}

.oauth2-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
    flex-wrap: wrap;
}

.oauth2-card-body {
    padding: 16px 20px;
}

.oauth2-output-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.oauth2-output {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--accent);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    padding: 10px 12px;
    word-break: break-all;
    white-space: pre-wrap;
    user-select: text;
    cursor: text;
}

.btn-copy {
    flex-shrink: 0;
    padding: 8px 14px;
    background: transparent;
    color: var(--info);
    border: 1px solid var(--info);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-copy:hover { background: rgba(96, 165, 250, 0.1); }

.btn-copy.copied {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-copy-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--info);
    border: 1px solid var(--info);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-copy-all:hover {
    background: rgba(96, 165, 250, 0.1);
}

.btn-copy-all:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-copy-all.copied {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 32px);
    width: 380px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.45;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
}

.toast-item.toast-out {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.toast-warning .toast-icon {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}
.toast-warning {
    border-color: rgba(251, 191, 36, 0.35);
}

.toast-error .toast-icon {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}
.toast-error {
    border-color: rgba(248, 113, 113, 0.35);
}

.toast-success .toast-icon {
    background: rgba(74, 222, 128, 0.15);
    color: var(--accent);
}
.toast-success {
    border-color: rgba(74, 222, 128, 0.35);
}

.toast-info .toast-icon {
    background: rgba(96, 165, 250, 0.15);
    color: var(--info);
}
.toast-info {
    border-color: rgba(96, 165, 250, 0.35);
}

.toast-message {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}



/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #app-header {
        padding: 0 14px;
    }

    .header-inner {
        gap: 8px;
    }

    .logo h1 {
        font-size: 1.05rem;
    }

    .header-right {
        gap: 8px;
    }

    .nav-link {
        padding: 5px 9px;
        font-size: 0.8rem;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-lang-toggle {
        padding: 4px 7px;
        font-size: 0.75rem;
    }

    .nav-github-star {
        padding: 5px 8px;
        gap: 4px;
    }

    .github-star-text {
        display: none;
    }

    #app-main {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .oauth2-action-group {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .mail-table .col-from,
    .mail-table .col-time {
        display: none;
    }

    .modal-content {
        max-width: 100%;
        max-height: 90vh;
    }

    .account-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    #app-header {
        padding: 0 10px;
    }

    .logo svg {
        width: 22px;
        height: 22px;
    }

    .logo h1 {
        font-size: 0.95rem;
    }

    .nav-links {
        gap: 2px;
    }

    .nav-link {
        padding: 4px 6px;
        font-size: 0.75rem;
    }

    .header-right {
        gap: 4px;
    }
}
