/* ===== 2006 Gmail Classic Style ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gmail-blue: #C3D9FF;
    --gmail-blue-dark: #5C7FB8;
    --gmail-blue-link: #1A0DAB;
    --gmail-selected: #C3D9FF;
    --gmail-hover: #E8EEF7;
    --gmail-bg: #FFFFFF;
    --gmail-text: #000000;
    --gmail-muted: #666666;
    --gmail-border: #CFCFCF;
    --gmail-red: #CC0000;
    --gmail-green: #006633;
    --gmail-star: #E8A317;
    --gmail-btn-bg: #DCDCDC;
    --gmail-btn-border: #BBBBBB;
    --gmail-label-bg: #E0ECF8;
    --gmail-row-even: #E8EEF7;
    --gmail-row-odd: #FFFFFF;
    --code-bg: #F5F5F5;
    --code-text: #333;
}

::selection {
    background: var(--gmail-blue);
    color: var(--gmail-text);
}

body {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    background: var(--gmail-bg);
    color: var(--gmail-text);
    margin: 0;
    padding: 0;
}

a {
    color: var(--gmail-blue-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--gmail-blue-link);
    background: none;
}

a:visited {
    color: #551A8B;
}

/* ===== Top Navigation Strip ===== */
.gmail-topnav {
    background: #DAEAF7;
    padding: 2px 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #B8D0E8;
}

.gmail-topnav-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gmail-topnav-left a {
    color: var(--gmail-blue-link);
    text-decoration: none;
    font-weight: bold;
}

.gmail-topnav-left a:hover { text-decoration: underline; }

.gmail-topnav-left .sep { color: #999; }

.gmail-topnav-right {
    font-size: 11px;
    color: var(--gmail-text);
}

.gmail-topnav-right a {
    color: var(--gmail-blue-link);
    margin-left: 6px;
}

/* ===== Header (Logo + Search) ===== */
.gmail-header {
    padding: 6px 10px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E8E8E8;
}

.gmail-logo {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    color: var(--gmail-text);
}

.gmail-logo:hover { text-decoration: none; }
.gmail-logo:visited { color: var(--gmail-text); }

.gmail-page-title {
    font-size: 16px;
    margin-left: 14px;
    color: var(--gmail-muted);
}

.gmail-logo-img {
    display: flex;
    align-items: baseline;
}

.gmail-logo-google {
    font-family: 'Catull', 'Times New Roman', serif;
    font-size: 30px;
    font-weight: normal;
    letter-spacing: -1px;
}

.gmail-logo-google .g1 { color: #4285F4; }
.gmail-logo-google .g2 { color: #EA4335; }
.gmail-logo-google .g3 { color: #FBBC05; }
.gmail-logo-google .g4 { color: #4285F4; }
.gmail-logo-google .g5 { color: #34A853; }
.gmail-logo-google .g6 { color: #EA4335; }

.gmail-logo-mail {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: #CC0000;
    margin-left: 1px;
}

.gmail-beta {
    font-family: Arial, sans-serif;
    font-size: 9px;
    color: var(--gmail-red);
    font-weight: bold;
    vertical-align: super;
    margin-left: 2px;
}

.gmail-search {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gmail-search input[type="text"] {
    width: 300px;
    padding: 3px 5px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    border: 1px solid #B5B8C8;
    background: var(--gmail-bg);
}

.gmail-search-btn {
    font-family: Arial, sans-serif;
    font-size: 12px;
    padding: 3px 10px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    color: var(--gmail-text);
    cursor: pointer;
    font-weight: bold;
}

.gmail-search-btn:hover {
    background: #CCC;
}

.gmail-search-links {
    font-size: 11px;
    margin-left: 8px;
}

.gmail-search-links a {
    color: var(--gmail-blue-link);
    font-size: 11px;
}

/* ===== Main Layout ===== */
.gmail-layout {
    display: flex;
    min-height: calc(100vh - 90px);
}

/* ===== Left Sidebar ===== */
.gmail-sidebar {
    width: 155px;
    min-width: 155px;
    padding: 8px 0;
    font-size: 13px;
}

.gmail-compose-link {
    display: block;
    padding: 4px 0 8px 10px;
    font-size: 13px;
    font-weight: bold;
    color: var(--gmail-blue-link);
    text-decoration: none;
}

.gmail-compose-link:hover {
    text-decoration: underline;
}

.gmail-compose-link:visited {
    color: var(--gmail-blue-link);
}

.gmail-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gmail-nav-list li a {
    display: block;
    padding: 1px 6px 1px 10px;
    color: var(--gmail-blue-link);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.7;
}

.gmail-nav-list li a:hover {
    text-decoration: underline;
}

.gmail-nav-list li a:visited {
    color: var(--gmail-blue-link);
}

.gmail-nav-list li.active a {
    font-weight: bold;
    background: var(--gmail-selected);
    color: var(--gmail-text);
    text-decoration: none;
}

.gmail-nav-count {
    color: var(--gmail-muted);
    font-size: 11px;
    font-weight: normal;
}

.gmail-sidebar-heading {
    font-size: 13px;
    font-weight: bold;
    color: var(--gmail-blue-link);
    padding: 10px 6px 2px 10px;
    cursor: default;
}

.gmail-sidebar-sub {
    font-size: 11px;
    color: var(--gmail-blue-link);
    padding: 2px 6px 2px 14px;
}

.gmail-sidebar-sub a {
    font-size: 11px;
}

/* Filter selects in sidebar */
.gmail-filter-select {
    display: block;
    margin: 4px 6px 4px 10px;
    padding: 1px 2px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    border: 1px solid var(--gmail-border);
    background: var(--gmail-bg);
    width: calc(100% - 16px);
}

/* ===== Main Content ===== */
.gmail-main {
    flex: 1;
    min-width: 0;
    overflow: auto;
    border-left: 1px solid #E8E8E8;
}

/* ===== Action Bar ===== */
.gmail-action-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--gmail-border);
    background: var(--gmail-bg);
    font-size: 12px;
    flex-wrap: wrap;
}

.gmail-action-btn {
    font-family: Arial, sans-serif;
    font-size: 12px;
    padding: 2px 10px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    color: var(--gmail-text);
    cursor: pointer;
    font-weight: bold;
}

.gmail-action-btn:hover {
    background: #CCC;
    color: var(--gmail-text);
}

.gmail-action-btn.danger {
    color: var(--gmail-red);
}

.gmail-action-btn.danger:hover {
    background: #FFE0E0;
}

.gmail-actions-select {
    font-family: Arial, sans-serif;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--gmail-btn-border);
    background: var(--gmail-btn-bg);
}

.gmail-select-links {
    font-size: 11px;
    color: var(--gmail-muted);
    margin-left: 4px;
}

.gmail-select-links a {
    font-size: 11px;
    color: var(--gmail-blue-link);
}

.gmail-pager {
    margin-left: auto;
    color: var(--gmail-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.gmail-pager a {
    font-size: 11px;
    color: var(--gmail-blue-link);
}

/* ===== Inbox Table ===== */
.gmail-inbox {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.gmail-inbox tr {
    border-bottom: 1px solid #E0E0E0;
    cursor: pointer;
}

.gmail-inbox tr:nth-child(even) {
    background: var(--gmail-row-even);
}

.gmail-inbox tr:nth-child(odd) {
    background: var(--gmail-row-odd);
}

.gmail-inbox tr:hover {
    background: var(--gmail-selected) !important;
}

.gmail-inbox tr.row-expanded {
    background: var(--gmail-selected) !important;
}

.gmail-inbox td {
    padding: 4px 4px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmail-inbox .col-check {
    width: 22px;
    text-align: center;
    padding: 4px 2px;
}

.gmail-inbox .col-star {
    width: 20px;
    text-align: center;
    padding: 4px 0;
}

.gmail-inbox .star {
    color: #DDD;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.gmail-inbox .star.starred {
    color: var(--gmail-star);
}

.gmail-inbox .col-from {
    width: 170px;
    font-size: 13px;
    padding-right: 6px;
    font-weight: bold;
}

.gmail-inbox .col-subject {
    font-size: 13px;
}

.gmail-inbox .col-subject .subject-text {
    font-weight: bold;
}

.gmail-inbox .col-subject .snippet {
    color: var(--gmail-muted);
    font-weight: normal;
    font-size: 12px;
}

.gmail-inbox .col-subject .label-tag {
    background: var(--gmail-label-bg);
    border: 1px solid #A8C4E0;
    color: #336699;
    font-size: 10px;
    padding: 0 4px;
    margin-right: 4px;
    font-weight: normal;
    white-space: nowrap;
}

.gmail-inbox .col-attachment {
    width: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--gmail-muted);
}

.gmail-inbox .col-date {
    width: 72px;
    text-align: right;
    font-size: 11px;
    color: var(--gmail-muted);
    padding-right: 8px;
}

/* ===== Expanded Detail Row ===== */
.detail-row {
    cursor: default !important;
}

.detail-row td {
    padding: 0 !important;
    border-bottom: 2px solid var(--gmail-border);
}

.detail-row:hover {
    background: var(--gmail-bg) !important;
}

.detail-panel {
    display: flex;
    gap: 0;
    background: var(--gmail-bg);
    min-height: 200px;
}

.detail-loading {
    padding: 20px;
    color: var(--gmail-muted);
    text-align: center;
    width: 100%;
    font-size: 12px;
}

.detail-left {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    max-height: 400px;
    padding: 10px 14px;
    border-right: 1px solid #E0E0E0;
}

.detail-left h3 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 6px;
    color: var(--gmail-text);
}

.detail-summary {
    font-size: 12px;
    color: var(--gmail-muted);
    margin-bottom: 8px;
    line-height: 1.5;
    border-left: 3px solid var(--gmail-blue);
    padding-left: 8px;
}

.detail-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 8px;
}

.detail-meta {
    font-size: 12px;
    color: var(--gmail-muted);
    margin-bottom: 8px;
    line-height: 1.6;
    padding: 6px 8px;
    background: #F6F6F6;
    border: 1px solid #E0E0E0;
}

.detail-meta strong {
    color: #444;
}

.detail-explanation {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--gmail-text);
    background: #F6F6F6;
    border: 1px solid #E0E0E0;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.detail-body {
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--gmail-muted);
    background: #F6F6F6;
    border: 1px solid #E0E0E0;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    margin: 0;
}

.detail-euler {
    font-size: 12px;
    line-height: 1.5;
    background: #F6F6F6;
    border: 1px solid #E0E0E0;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.detail-euler-links {
    margin-top: 4px;
}

.detail-euler-links a {
    display: inline-block;
    margin-right: 8px;
    font-size: 11px;
}

.detail-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-open-btn {
    display: inline-block;
    padding: 2px 10px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    color: var(--gmail-text);
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
}

.detail-open-btn:hover {
    background: #CCC;
    text-decoration: none;
    color: var(--gmail-text);
}

/* Detail right: file viewer */
.detail-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.detail-file-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #F0F0F0;
    border-bottom: 1px solid var(--gmail-border);
}

.file-tab {
    padding: 3px 10px;
    background: #F0F0F0;
    color: var(--gmail-muted);
    border: none;
    border-right: 1px solid #DDD;
    cursor: pointer;
    font-size: 11px;
    font-family: Arial, sans-serif;
}

.file-tab:hover {
    background: var(--gmail-hover);
    color: var(--gmail-text);
}

.file-tab.active {
    background: var(--gmail-bg);
    color: var(--gmail-text);
    font-weight: bold;
}

.detail-file-contents {
    flex: 1;
    overflow: hidden;
    background: var(--gmail-bg);
}

.file-content-pane {
    display: none;
    height: 100%;
}

.file-content-pane.active {
    display: block;
}

.detail-code {
    margin: 0;
    padding: 8px;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    overflow: auto;
    max-height: 340px;
    white-space: pre;
    color: var(--code-text);
    background: var(--code-bg);
}

.detail-code code {
    font-family: inherit;
}

.detail-image {
    padding: 8px;
    text-align: center;
    overflow: auto;
    max-height: 340px;
}

.detail-image img {
    max-width: 100%;
    height: auto;
}

.detail-binary {
    padding: 20px;
    text-align: center;
    color: var(--gmail-muted);
    font-size: 12px;
}

/* ===== Intro Draft Email ===== */
.intro-row {
    background: #FFF9E5 !important;
    border-left: 3px solid var(--gmail-star);
}

.intro-row:hover {
    background: #FFF3CC !important;
}

.intro-row.row-expanded {
    background: #FFF9E5 !important;
}

.intro-row.row-expanded td {
    border-bottom: none;
}

.intro-detail {
    cursor: default !important;
}

.intro-detail:hover {
    background: var(--gmail-bg) !important;
}

.intro-detail td {
    border-bottom: 2px solid var(--gmail-star) !important;
    white-space: normal !important;
}

.intro-email-body {
    background: var(--gmail-bg);
}

.intro-email-content {
    padding: 10px 14px 16px 56px;
    font-size: 13px;
    line-height: 1.7;
    max-width: 700px;
    white-space: normal;
    word-wrap: break-word;
}

.intro-email-content p {
    margin-bottom: 10px;
    white-space: normal;
}

.intro-email-content em {
    color: var(--gmail-muted);
}

.gmail-intro-code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 8px 12px;
    margin: 6px 0;
    border: 1px solid #DDD;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
}

/* ===== Rainbow Skill Button ===== */
@keyframes rainbow-text {
    0%   { color: #ff0000; }
    15%  { color: #ff8800; }
    30%  { color: #ffdd00; }
    45%  { color: #00cc44; }
    60%  { color: #0088ff; }
    75%  { color: #8800ff; }
    90%  { color: #ff00cc; }
    100% { color: #ff0000; }
}

@keyframes rainbow-glow {
    0%   { text-shadow: 0 0 6px #ff000088, 0 0 14px #ff000044; }
    15%  { text-shadow: 0 0 6px #ff880088, 0 0 14px #ff880044; }
    30%  { text-shadow: 0 0 6px #ffdd0088, 0 0 14px #ffdd0044; }
    45%  { text-shadow: 0 0 6px #00cc4488, 0 0 14px #00cc4444; }
    60%  { text-shadow: 0 0 6px #0088ff88, 0 0 14px #0088ff44; }
    75%  { text-shadow: 0 0 6px #8800ff88, 0 0 14px #8800ff44; }
    90%  { text-shadow: 0 0 6px #ff00cc88, 0 0 14px #ff00cc44; }
    100% { text-shadow: 0 0 6px #ff000088, 0 0 14px #ff000044; }
}

@keyframes border-spin {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes dash-rotate {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -32; }
}

.skill-btn-rainbow {
    position: relative;
    display: inline-block;
    padding: 3px 10px;
    font-weight: bold !important;
    font-size: 12px;
    animation: rainbow-text 3s linear infinite, rainbow-glow 3s linear infinite;
    text-decoration: none !important;
    z-index: 1;
}

.skill-btn-rainbow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 4px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        #ff0000, #ff8800, #ffdd00, #00cc44, #0088ff, #8800ff, #ff00cc, #ff0000,
        #ff8800, #ffdd00, #00cc44, #0088ff, #8800ff, #ff00cc, #ff0000
    );
    background-size: 300% 100%;
    animation: border-spin 3s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    pointer-events: none;
}

/* Dashed rotating border via SVG overlay */
.skill-btn-rainbow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 6px;
    border: 2px dashed transparent;
    background: none;
    z-index: -2;
    pointer-events: none;
    /* Animated dashed border using outline trick */
    outline: 2px dashed rgba(136, 0, 255, 0.3);
    outline-offset: 2px;
    animation: rainbow-outline 3s linear infinite;
}

@keyframes rainbow-outline {
    0%   { outline-color: rgba(255, 0, 0, 0.4); }
    15%  { outline-color: rgba(255, 136, 0, 0.4); }
    30%  { outline-color: rgba(255, 221, 0, 0.4); }
    45%  { outline-color: rgba(0, 204, 68, 0.4); }
    60%  { outline-color: rgba(0, 136, 255, 0.4); }
    75%  { outline-color: rgba(136, 0, 255, 0.4); }
    90%  { outline-color: rgba(255, 0, 204, 0.4); }
    100% { outline-color: rgba(255, 0, 0, 0.4); }
}

.skill-btn-rainbow:hover {
    text-decoration: none !important;
    animation: rainbow-text 1.5s linear infinite, rainbow-glow-strong 1.5s linear infinite;
}

@keyframes rainbow-glow-strong {
    0%   { text-shadow: 0 0 8px #ff0000aa, 0 0 20px #ff000066, 0 0 30px #ff000033; }
    15%  { text-shadow: 0 0 8px #ff8800aa, 0 0 20px #ff880066, 0 0 30px #ff880033; }
    30%  { text-shadow: 0 0 8px #ffdd00aa, 0 0 20px #ffdd0066, 0 0 30px #ffdd0033; }
    45%  { text-shadow: 0 0 8px #00cc44aa, 0 0 20px #00cc4466, 0 0 30px #00cc4433; }
    60%  { text-shadow: 0 0 8px #0088ffaa, 0 0 20px #0088ff66, 0 0 30px #0088ff33; }
    75%  { text-shadow: 0 0 8px #8800ffaa, 0 0 20px #8800ff66, 0 0 30px #8800ff33; }
    90%  { text-shadow: 0 0 8px #ff00ccaa, 0 0 20px #ff00cc66, 0 0 30px #ff00cc33; }
    100% { text-shadow: 0 0 8px #ff0000aa, 0 0 20px #ff000066, 0 0 30px #ff000033; }
}

/* Override visited color for rainbow btn */
.skill-btn-rainbow:visited {
    animation: rainbow-text 3s linear infinite, rainbow-glow 3s linear infinite;
}

/* Memoir CTA version gets slightly larger treatment */
.memoir-cta .skill-btn-rainbow {
    padding: 4px 14px;
    font-size: 13px;
}

/* ===== Memoir CTA ===== */
.memoir-cta {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #DDD;
    font-size: 12px;
    color: var(--gmail-muted);
    line-height: 1.7;
}

.memoir-cta p {
    margin-bottom: 6px;
}

.memoir-cta a {
    color: var(--gmail-blue-link);
    font-weight: bold;
}

.memoir-cta a:hover {
    text-decoration: underline;
}

/* ===== Tags ===== */
.tag-sm {
    display: inline-block;
    background: var(--gmail-label-bg);
    border: 1px solid #A8C4E0;
    color: #336699;
    font-size: 10px;
    padding: 0 4px;
    margin: 1px;
}

.tag-sm:before, .tag-sm:after { content: none; }

.tag {
    display: inline-block;
    background: var(--gmail-label-bg);
    border: 1px solid #A8C4E0;
    color: #336699;
    font-size: 11px;
    padding: 0 5px;
    margin: 1px;
}

.tag:before, .tag:after { content: none; }

.topic-tag { color: #336699; }

/* ===== Headings ===== */
h1 {
    font-size: 20px;
    font-weight: normal;
    color: var(--gmail-text);
    margin-bottom: 4px;
}

h2 {
    font-size: 14px;
    font-weight: bold;
    color: var(--gmail-text);
    margin: 12px 0 6px;
    border-bottom: 1px solid #E0E0E0;
    padding-bottom: 3px;
}

h3 { font-size: 13px; font-weight: bold; }
h4 { font-size: 13px; font-weight: bold; }

.count {
    font-weight: normal;
    color: var(--gmail-muted);
    font-size: 13px;
}

/* ===== Grid View ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0;
}

.project-card-wrapper {
    position: relative;
}

.project-card {
    display: block;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--gmail-text);
    border-bottom: 1px solid #E0E0E0;
}

.project-card:hover {
    background-color: var(--gmail-selected);
    text-decoration: none;
}

.project-card:hover h3 { color: var(--gmail-blue-link); }
.project-card:visited { color: var(--gmail-text); }

.card-header { margin-bottom: 2px; }

.date {
    font-size: 11px;
    color: var(--gmail-muted);
}

.project-card h3 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 2px;
}

.file-count {
    font-size: 11px;
    color: var(--gmail-muted);
}

.desc {
    font-size: 12px;
    color: var(--gmail-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.project-card-wrapper .delete-form {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 1;
}

.delete-btn {
    border: none;
    background: transparent;
    color: #CCC;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
}

.delete-btn:hover {
    color: var(--gmail-red);
    background: transparent;
}

.notes-indicator {
    color: var(--gmail-star);
    font-size: 12px;
}

.notes-preview {
    color: var(--gmail-star) !important;
    font-style: italic;
}

/* ===== Table actions ===== */
.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--gmail-border);
    font-size: 11px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gmail-muted);
    cursor: pointer;
}

.bulk-delete-btn {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    color: var(--gmail-red);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.bulk-delete-btn:hover {
    background: #FFE0E0;
}

.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.project-table thead { position: sticky; top: 0; z-index: 1; }

.project-table th {
    background: #F6F6F6;
    border-bottom: 1px solid var(--gmail-border);
    padding: 3px 6px;
    text-align: left;
    font-weight: bold;
    color: var(--gmail-muted);
    font-size: 11px;
}

.project-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #E0E0E0;
    vertical-align: middle;
}

.project-table tbody tr:nth-child(4n+1) { background: var(--gmail-row-even); }
.project-table tbody tr:nth-child(4n+3) { background: var(--gmail-row-odd); }

.project-table tbody tr.project-row:hover {
    background-color: var(--gmail-selected) !important;
}

.col-check { width: 24px; }
.col-date { width: 80px; }
.col-files { width: 40px; text-align: center; }
.col-notes { width: 36px; text-align: center; }
.col-actions { width: 30px; }

.cell-date { color: var(--gmail-muted); font-size: 11px; white-space: nowrap; }
.cell-files { text-align: center; color: var(--gmail-muted); font-size: 11px; }
.cell-notes { text-align: center; }
.cell-topics { max-width: 200px; }

.delete-row-btn {
    background: transparent;
    border: none;
    color: #CCC;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
}

.delete-row-btn:hover {
    color: var(--gmail-red);
    background: transparent;
}

/* Row expand */
.project-row { cursor: pointer; }

.project-row.row-expanded {
    background: var(--gmail-selected) !important;
}

.project-row.row-expanded td {
    border-bottom: none;
}

/* ===== Euler box ===== */
.euler-problem-box {
    border: 1px solid #DDD;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: #FFFFF5;
    line-height: 1.5;
    font-size: 12px;
}

.euler-links { margin-top: 4px; }

.euler-links a {
    display: inline-block;
    margin-right: 10px;
    font-size: 11px;
}

/* ===== Project Detail Page (Gmail Email View) ===== */
.gmail-detail-container {
    padding: 0;
}

/* Action bar at top */
.email-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    border-bottom: 1px solid #E0E0E0;
}

.email-action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.back-link {
    display: inline-block;
    color: var(--gmail-blue-link);
    text-decoration: none;
    font-size: 12px;
}

.back-link:hover { text-decoration: underline; background: none; }

/* Subject bar */
.email-subject-bar {
    padding: 10px 14px 6px;
    border-bottom: 1px solid #E0E0E0;
}

.email-subject {
    font-size: 20px;
    font-weight: normal;
    color: var(--gmail-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.email-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.email-label {
    display: inline-block;
    background: var(--gmail-label-bg);
    border: 1px solid #A8C4E0;
    color: #336699;
    font-size: 10px;
    padding: 0 5px;
}

/* Email message container */
.email-message {
    margin: 0 14px;
    border-bottom: 1px solid #E0E0E0;
}

/* Sender bar */
.email-sender-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0 8px;
}

.email-sender-left {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.email-sender-avatar {
    width: 32px;
    height: 32px;
    background: var(--gmail-blue);
    color: var(--gmail-blue-dark);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.email-sender-info {
    font-size: 13px;
}

.email-sender-name strong {
    font-size: 13px;
}

.email-sender-to {
    color: var(--gmail-muted);
    font-size: 11px;
    margin-left: 4px;
}

.email-sender-subject {
    color: var(--gmail-muted);
    font-size: 11px;
    margin-top: 1px;
}

.email-date {
    color: var(--gmail-muted);
    font-size: 11px;
    white-space: nowrap;
}

/* Message body */
.email-message-body {
    padding: 10px 0 14px 42px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gmail-text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Euler box inside email */
.email-euler-box {
    margin: 0 0 12px 42px;
    padding: 8px 10px;
    background: #FFFFF5;
    border: 1px solid #E8E0B0;
    font-size: 12px;
    line-height: 1.5;
}

.email-euler-box .euler-links {
    margin-top: 4px;
}

.email-euler-box .euler-links a {
    font-size: 11px;
    margin-right: 8px;
}

/* Attachments section */
.email-attachments {
    padding: 10px 0 10px 42px;
    border-top: 1px solid #E8E8E8;
}

.email-attachments-header {
    font-size: 12px;
    color: var(--gmail-muted);
    margin-bottom: 6px;
    font-weight: bold;
}

.attachment-icon {
    font-size: 13px;
}

.email-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.email-attachment-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid #DDD;
    border-bottom: none;
    background: #FAFAFA;
    cursor: pointer;
    font-size: 12px;
}

.email-attachment-card:last-of-type,
.file-expandable:last-child .email-attachment-card {
    border-bottom: 1px solid #DDD;
}

.email-attachment-card:hover {
    background: var(--gmail-hover);
}

.email-attachment-card.attachment-active {
    background: var(--gmail-selected);
    border-color: #A8C4E0;
}

.attachment-card-icon {
    font-size: 18px;
    color: var(--gmail-muted);
    flex-shrink: 0;
}

.attachment-card-info {
    flex: 1;
    min-width: 0;
}

.attachment-card-name {
    font-weight: bold;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-card-size {
    font-size: 10px;
    color: var(--gmail-muted);
}

.attachment-open-link {
    font-size: 11px;
    color: var(--gmail-blue-link);
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid var(--gmail-btn-border);
    background: var(--gmail-btn-bg);
    font-weight: bold;
    white-space: nowrap;
}

.attachment-open-link:hover {
    background: #CCC;
    text-decoration: none;
    color: var(--gmail-text);
}

.attachment-open-link:visited {
    color: var(--gmail-blue-link);
}

/* Reply/forward bar */
.email-reply-bar {
    display: flex;
    gap: 6px;
    padding: 10px 0 12px 42px;
    align-items: center;
}

.email-reply-bar .gmail-action-btn {
    text-decoration: none;
}

/* Thread section */
.email-thread-section {
    margin: 0 14px;
    padding: 10px 0;
    border-bottom: 1px solid #E0E0E0;
}

.email-thread-header {
    font-size: 12px;
    color: var(--gmail-muted);
    font-weight: bold;
    margin-bottom: 6px;
}

.email-thread-item {
    padding: 3px 0 3px 42px;
    font-size: 12px;
    border-bottom: 1px solid #F0F0F0;
}

.email-thread-meta {
    color: var(--gmail-muted);
    font-size: 11px;
    margin-left: 8px;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 14px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 8px;
    border-bottom: 1px solid #E8E8E8;
    text-decoration: none;
    color: var(--gmail-text);
    font-size: 13px;
}

.file-item:hover {
    background-color: var(--gmail-selected);
    color: var(--gmail-blue-link);
}

.file-item-active {
    background-color: var(--gmail-selected);
    color: var(--gmail-blue-link);
}

.file-item-active .file-meta { color: var(--gmail-blue-link); }

.file-content-area {
    border: 1px solid #DDD;
    border-top: none;
    margin-bottom: 0;
}

.file-preview-code {
    margin: 0;
    padding: 8px;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    overflow: auto;
    max-height: 500px;
    white-space: pre;
    background: var(--code-bg);
    color: var(--code-text);
}

.file-preview-code code { font-family: inherit; }

.file-preview-loading {
    padding: 14px;
    color: var(--gmail-muted);
    text-align: center;
    font-size: 12px;
}

.file-preview-img {
    padding: 8px;
    text-align: center;
    background: var(--code-bg);
}

.file-preview-img img {
    max-width: 100%;
    height: auto;
}

.file-name { font-size: 13px; }

.file-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--gmail-muted);
}

.file-item:hover .file-meta { color: var(--gmail-blue-link); }

.file-lang {
    background: var(--gmail-label-bg);
    border: 1px solid #A8C4E0;
    color: #336699;
    font-size: 10px;
    padding: 0 4px;
}

.file-lang:before, .file-lang:after { content: none; }

/* Email thread */
.email-thread-item {
    border-bottom: 1px solid #E8E8E8;
    padding: 6px 0;
    font-size: 12px;
}

.email-thread-item p {
    font-size: 11px;
    color: var(--gmail-muted);
}

/* Notes section */
.notes-section {
    margin: 0 14px;
    padding: 10px 0 14px 42px;
}

.notes-hint {
    font-size: 11px;
    color: var(--gmail-muted);
    margin-bottom: 4px;
}

.notes-input {
    width: 100%;
    padding: 6px 8px;
    background: var(--gmail-bg);
    border: 1px solid var(--gmail-border);
    color: var(--gmail-text);
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

.notes-input:focus {
    outline: 1px solid var(--gmail-blue-dark);
    border-color: var(--gmail-blue-dark);
}

.notes-save-btn { margin-top: 4px; }

/* ===== Viewer Page ===== */
.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

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

.run-btn {
    padding: 2px 10px;
    font-weight: bold;
    font-size: 11px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    cursor: pointer;
    font-family: Arial, sans-serif;
    color: var(--gmail-text);
}

.run-btn:hover { background: #CCC; color: var(--gmail-text); }
.run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Code container */
.code-container {
    border: 1px solid #DDD;
    overflow: auto;
    font-size: 12px;
}

.code-container .highlight { margin: 0; padding: 8px; }

.code-container .highlight pre {
    margin: 0;
    white-space: pre;
    overflow-x: auto;
}

.image-viewer {
    border: 1px solid #DDD;
    padding: 10px;
    text-align: center;
}

.image-viewer img { max-width: 100%; height: auto; }

.binary-notice {
    text-align: center;
    padding: 30px;
    border: 1px solid #DDD;
    color: var(--gmail-muted);
    font-size: 12px;
}

/* Code blocks */
pre {
    background-color: var(--code-bg);
    border: 1px solid #DDD;
    padding: 8px;
    overflow: auto;
    color: var(--code-text);
    font-size: 12px;
    line-height: 1.5;
    font-family: 'Courier New', Courier, monospace;
}

/* Output Panel */
.output-panel {
    margin-top: 10px;
    border: 1px solid #DDD;
    overflow: hidden;
}

.output-panel h3 {
    padding: 4px 8px;
    border-bottom: 1px solid #DDD;
    font-size: 12px;
    background: #F6F6F6;
}

.output-status {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
}

.output-status.running { color: #996600; }
.output-status.success { color: var(--gmail-green); }
.output-status.error { color: var(--gmail-red); }

.output-stdout, .output-stderr {
    padding: 8px;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.output-stdout { background: var(--code-bg); color: var(--gmail-text); }

.output-stderr {
    background: #FFF0F0;
    color: var(--gmail-red);
    border-top: 1px solid #DDD;
}

/* ===== Run Controls ===== */
.run-controls {
    padding: 4px 8px;
    background: #F6F6F6;
    border-top: 1px solid #DDD;
}

.run-btn-inline {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--gmail-btn-bg);
    border: 1px solid var(--gmail-btn-border);
    color: var(--gmail-text);
    font-weight: bold;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.run-btn-inline:hover { background: #CCC; color: var(--gmail-text); }

.stdin-input {
    margin-left: 4px;
    padding: 2px 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    border: 1px solid var(--gmail-border);
    background: var(--gmail-bg);
    color: var(--gmail-text);
    width: 200px;
}

.run-output {
    margin: 4px 0 0;
    padding: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    background: var(--gmail-bg);
    border: 1px solid #DDD;
    color: var(--gmail-text);
}

.run-output.run-error { color: var(--gmail-red); background: #FFF0F0; }
.run-output.run-running { color: #996600; }

.run-iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #DDD;
    margin-top: 4px;
    background: #fff;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gmail-muted);
    font-size: 13px;
}

.empty-state code {
    background: var(--code-bg);
    padding: 2px 6px;
    font-size: 12px;
    border: 1px solid #DDD;
    font-family: 'Courier New', Courier, monospace;
}

/* ===== Footer ===== */
.gmail-footer {
    text-align: center;
    padding: 12px 8px;
    font-size: 11px;
    color: var(--gmail-muted);
    border-top: 1px solid #E0E0E0;
    margin-top: 8px;
}

.gmail-footer a {
    color: var(--gmail-blue-link);
    font-size: 11px;
}

.gmail-footer-storage {
    font-weight: bold;
    margin-bottom: 4px;
}

.gmail-footer-links {
    margin-bottom: 2px;
}

.gmail-footer-links a {
    margin: 0 4px;
}

/* ===== Static Mode (S3 deployment) ===== */
body.static-mode form[action^="/delete/"],
body.static-mode .delete-form,
body.static-mode .gmail-action-btn.danger,
body.static-mode .bulk-delete-btn,
body.static-mode .delete-btn,
body.static-mode .delete-row-btn { display: none !important; }

body.static-mode form[action*="/notes"],
body.static-mode .notes-section { display: none !important; }

body.static-mode #run-btn:not(.client-runnable),
body.static-mode #output-panel:not(.client-runnable) { display: none !important; }

body.static-mode .gmail-compose-link { display: none !important; }

body.static-mode .gmail-select-links { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .gmail-layout { flex-direction: column; }
    .gmail-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #E0E0E0;
        padding: 4px 0;
    }
    .gmail-nav-list { display: flex; flex-wrap: wrap; }
    .gmail-nav-list li a { padding: 3px 8px; font-size: 12px; }
    .gmail-compose-link { display: inline-block; padding: 3px 10px; }
    .gmail-search input[type="text"] { width: 160px; }
    .gmail-inbox .col-from { width: 100px; }
    .detail-panel { flex-direction: column; }
    .detail-left { max-height: none; border-right: none; border-bottom: 1px solid #E0E0E0; }
    .detail-right { max-height: 300px; }
    .gmail-topnav { flex-direction: column; align-items: flex-start; gap: 2px; }
    .gmail-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .gmail-filter-select { width: auto; }
}
