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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.mail-container {
    display: flex;
    height: 100vh;
    background-color: white;
}

/* Sidebar */
.sidebar {
    width: 260px;
    border-right: 1px solid #e0e0e0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: #202124;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.7;
}

.logo-text {
    font-size: 1.3rem;
}

.compose-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: #c2e7ff;
    border: none;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.compose-btn:hover {
    background-color: #a8d8f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0 20px 20px 0;
    color: #202124;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    position: relative;
}

.nav-item:hover {
    background-color: #f1f3f4;
}

.nav-item.active {
    background-color: #fce8e6;
    color: #d93025;
    font-weight: 500;
}

.nav-item .count {
    margin-left: auto;
    font-size: 0.85rem;
    color: inherit;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

.header-logo {
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header-logo:hover {
    opacity: 0.7;
}

.header-logo-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #202124;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: #eaf1fb;
    border-radius: 8px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f1f3f4;
}

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

/* Dropdown menu */
.menu-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #202124;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f1f3f4;
}

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

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

.icon-btn.disabled:hover,
.icon-btn:disabled:hover {
    background-color: transparent;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Selection toolbar */
.selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #c2e7ff;
    border-bottom: 1px solid #a8d8f5;
}

.selection-toolbar.hidden {
    display: none;
}

.selection-count {
    font-size: 0.9rem;
    font-weight: 500;
    color: #202124;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-info {
    font-size: 0.85rem;
    color: #5f6368;
}

/* Email list */
.email-list {
    flex: 1;
    overflow-y: auto;
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header svg {
    color: #5f6368;
}

.section-header .page-info {
    font-size: 0.85rem;
    color: #5f6368;
}

.email-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.email-item:hover {
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    z-index: 1;
}

.email-item.unread {
    background-color: #ffffff;
    font-weight: 500;
}

.email-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.email-star {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #5f6368;
}

.email-star.starred {
    color: #f9ab00;
    fill: #f9ab00;
}

.email-important {
    width: 20px;
    height: 20px;
    color: #f9ab00;
}

.email-arrow {
    width: 20px;
    height: 20px;
    color: #5f6368;
}

.email-item.pinned {
    cursor: pointer;
}

.email-item.pinned:hover {
    background-color: #f8f9fa;
}

.email-sender {
    width: 180px;
    font-size: 0.9rem;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-content {
    flex: 1;
    font-size: 0.9rem;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.email-subject {
    color: #202124;
    font-weight: 500;
}

.email-preview {
    color: #5f6368;
    font-weight: 400;
}

.email-time {
    font-size: 0.85rem;
    color: #5f6368;
    white-space: nowrap;
}

/* Email detail view */
.email-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.email-detail.hidden {
    display: none;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-subject {
    font-size: 1.5rem;
    font-weight: 400;
    color: #202124;
    margin: 0;
    flex: 1;
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.detail-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #5f6368;
}

.heart-btn:hover {
    background-color: #f1f3f4;
}

.heart-btn.hearted {
    color: #ea4335;
}

.heart-btn.hearted svg {
    fill: #ea4335;
}

.heart-count {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

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

.heart-btn.disabled:hover,
.heart-btn:disabled:hover {
    background-color: transparent;
}

.sender-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-sender {
    font-size: 0.95rem;
    color: #202124;
}

.detail-timestamp {
    font-size: 0.85rem;
    color: #5f6368;
}

.detail-body {
    padding: 2rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #202124;
    white-space: pre-wrap;
}

.detail-body a {
    color: #1a73e8;
    text-decoration: underline;
}

.detail-body a:hover {
    color: #1557b0;
}

.detail-body strong {
    font-weight: 600;
}

.detail-body em {
    font-style: italic;
}

/* Replies section */
.replies-section {
    margin-top: 2rem;
}

.reply-item {
    padding: 1.5rem 0 1.5rem 0;
    border-top: 1px solid #e0e0e0;
}

.reply-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.reply-sender {
    font-size: 0.9rem;
    color: #202124;
    font-weight: 500;
}

.reply-timestamp {
    font-size: 0.85rem;
    color: #5f6368;
}

.reply-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #202124;
    white-space: pre-wrap;
}

.reply-body a {
    color: #1a73e8;
    text-decoration: underline;
}

.reply-body a:hover {
    color: #1557b0;
}

.reply-body strong {
    font-weight: 600;
}

.reply-body em {
    font-style: italic;
}

/* Reply form */
.reply-form-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: none;
}

.reply-form-container.visible {
    display: block;
}

.reply-form {
    display: flex;
    flex-direction: column;
}

.reply-compose-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.reply-compose-box:focus-within {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: #c2e7ff;
}

.reply-textarea {
    width: 100%;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 1rem;
    font-size: 0.95rem;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    outline: none;
}

.reply-editor {
    width: 100%;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 1rem;
    font-size: 0.95rem;
    min-height: 80px;
    font-family: inherit;
    outline: none;
    line-height: 1.6;
    overflow-y: auto;
}

.reply-editor:empty:before {
    content: attr(data-placeholder);
    color: #9aa0a6;
    pointer-events: none;
}

.reply-editor strong {
    font-weight: 600;
}

.reply-editor em {
    font-style: italic;
}

.reply-editor a {
    color: #1a73e8;
    text-decoration: underline;
}

.reply-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
    border-radius: 0 0 8px 8px;
    flex-wrap: wrap;
}

.send-btn-reply {
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn-reply:hover {
    background-color: #1557b0;
}

.send-btn-reply:disabled {
    background-color: #8ab4f8;
    cursor: not-allowed;
}

.reply-name-inline {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 0.85rem;
    outline: none;
    color: #5f6368;
}

.reply-name-inline::placeholder {
    color: #9aa0a6;
}

/* Compose modal */
.compose-modal {
    position: fixed;
    bottom: 0;
    right: 80px;
    z-index: 1000;
}

.compose-modal.hidden {
    display: none;
}

.compose-window {
    width: 550px;
    background-color: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #404040;
    color: white;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
}

.compose-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compose-header-actions .format-btn {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.compose-header-actions .format-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.compose-header-actions .format-btn strong,
.compose-header-actions .format-btn em {
    color: white;
}

.send-btn-header {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.send-btn-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.send-btn-header svg {
    width: 20px;
    height: 20px;
}

.compose-field {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.compose-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 0.5rem;
}

.formatting-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.formatting-toolbar-inline {
    display: flex;
    gap: 0.25rem;
    padding: 0;
    border: none;
}

.format-btn {
    background: none;
    border: 1px solid #dadce0;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #5f6368;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-btn:hover {
    background-color: #f1f3f4;
    border-color: #5f6368;
}

.format-btn strong,
.format-btn em {
    font-size: 0.95rem;
    color: #202124;
}

.compose-field input {
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.compose-field textarea {
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 1rem;
    min-height: 300px;
    resize: vertical;
    font-family: inherit;
}

.compose-editor {
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 1rem;
    min-height: 300px;
    font-family: inherit;
    line-height: 1.6;
    overflow-y: auto;
}

.compose-editor:empty:before {
    content: attr(data-placeholder);
    color: #9aa0a6;
    pointer-events: none;
}

.compose-editor strong {
    font-weight: 600;
}

.compose-editor em {
    font-style: italic;
}

.compose-editor a {
    color: #1a73e8;
    text-decoration: underline;
}

.compose-footer {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.send-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #1557b0;
}

.send-btn:disabled {
    background-color: #8ab4f8;
    cursor: not-allowed;
}

.send-status {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 1rem 1rem 1rem;
    text-align: center;
}

.send-status.success {
    background-color: #e6f4ea;
    color: #137333;
}

.send-status.error {
    background-color: #fce8e6;
    color: #c5221f;
}

/* Feedback compose view */
.feedback-compose-view {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
}

.feedback-compose-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.feedback-compose-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #202124;
}

.feedback-form {
    display: flex;
    flex-direction: column;
}

.feedback-field {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-field:last-of-type {
    border-bottom: none;
    flex: 1;
}

.feedback-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    background-color: #f8f9fa;
    color: #5f6368;
}

.feedback-textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 1rem 0;
    min-height: 400px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.feedback-textarea.feedback-placeholder {
    color: #9aa0a6;
    font-style: italic;
}

.feedback-footer {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.feedback-inline-input {
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 0.85rem;
    outline: none;
    color: #5f6368;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.feedback-inline-input:focus {
    border-bottom-color: #dadce0;
}

.feedback-inline-input::placeholder {
    color: #9aa0a6;
}

/* Link modal */
.link-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1);
}

.link-modal.hidden {
    display: none;
}

.link-modal-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 1rem;
}

.link-modal-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 2px solid #1a73e8;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background-color: white;
}

.link-modal-input-container svg {
    color: #5f6368;
    flex-shrink: 0;
}

.link-input {
    border: none;
    outline: none;
    font-size: 0.95rem;
    width: 300px;
    color: #202124;
}

.link-input::placeholder {
    color: #9aa0a6;
}

.link-apply-btn {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.link-apply-btn:hover {
    background-color: #f1f3f4;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .mail-container {
        flex-direction: column;
    }

    /* Sidebar becomes horizontal bottom nav */
    .sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        padding: 0.5rem;
        position: fixed;
        bottom: 0;
        left: 0;
        background-color: white;
        z-index: 100;
        justify-content: space-around;
        align-items: center;
    }

    .logo {
        display: none;
    }

    .compose-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex: 1;
        justify-content: space-around;
    }

    .nav-item {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        border-radius: 8px;
        font-size: 0.75rem;
        text-align: center;
        min-width: 60px;
    }

    .nav-item svg {
        width: 20px;
        height: 20px;
    }

    .nav-item .count {
        position: absolute;
        top: -5px;
        right: -5px;
        background-color: #d93025;
        color: white;
        border-radius: 10px;
        padding: 2px 6px;
        font-size: 0.7rem;
        margin-left: 0;
    }

    .nav-item {
        position: relative;
    }

    /* Main content */
    .main-content {
        padding-bottom: 70px;
    }

    /* Header */
    .header {
        padding: 0.75rem 0.5rem;
    }

    .header-logo {
        display: flex; /* Show on mobile */
    }

    .search-bar {
        padding: 0.5rem;
    }

    .search-bar input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Email list */
    .email-item {
        padding: 1.25rem 1rem;
        gap: 0.75rem;
        min-height: 90px;
        align-items: flex-start;
    }

    .email-checkbox {
        width: 16px;
        height: 16px;
        margin-top: 0.25rem;
    }

    .email-star,
    .email-important {
        margin-top: 0.25rem;
    }

    .email-sender {
        width: 80px;
        font-size: 0.85rem;
    }

    .email-content {
        font-size: 0.85rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }

    .email-subject {
        display: inline;
    }

    .email-preview {
        display: inline;
    }

    .email-time {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    .section-header {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Email detail view */
    .email-detail {
        padding: 1rem;
    }

    .detail-header {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .detail-subject {
        font-size: 1.2rem;
    }

    .detail-meta {
        padding: 0.75rem 0;
    }

    .detail-sender {
        font-size: 0.9rem;
    }

    .detail-timestamp {
        font-size: 0.8rem;
    }

    .detail-body {
        padding: 1rem 0;
        font-size: 0.9rem;
    }

    /* Replies */
    .reply-item {
        padding: 1rem 0;
    }

    .reply-sender {
        font-size: 0.85rem;
    }

    .reply-timestamp {
        font-size: 0.75rem;
    }

    .reply-body {
        font-size: 0.85rem;
    }

    /* Reply form */
    .reply-form-container {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .reply-textarea,
    .reply-editor {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.75rem;
        min-height: 60px;
    }

    .reply-toolbar {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }

    .send-btn-reply {
        padding: 0.4rem 1.25rem;
        font-size: 0.85rem;
    }

    .reply-name-inline {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    /* Compose modal */
    .compose-modal {
        align-items: flex-end;
        padding: 0;
    }

    .compose-window {
        width: 100%;
        height: 100vh;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
        animation: slideUpMobile 0.3s ease-out;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        overflow-y: auto;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .compose-field input,
    .compose-field textarea,
    .compose-editor {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .compose-field textarea {
        min-height: 200px;
    }

    .compose-editor {
        min-height: 300px;
        flex: 1;
    }

    .compose-header {
        padding: 1rem;
    }

    .send-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Feedback view */
    .feedback-compose-view {
        padding: 1rem;
    }

    .feedback-compose-header h2 {
        font-size: 1.3rem;
    }

    .feedback-input,
    .feedback-textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .feedback-textarea {
        min-height: 300px;
    }

    /* E-Pen Pals mobile */
    .pen-pals-view {
        padding: 1rem;
    }

    .pen-pals-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .pen-pals-header h2 {
        font-size: 1.5rem;
    }

    .pen-pals-subtitle {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .pen-pals-signup-btn {
        width: 100%;
    }

    .pen-pals-table {
        font-size: 0.8rem;
    }

    .pen-pals-table th,
    .pen-pals-table td {
        padding: 0.5rem;
    }

    .pen-pals-table th:nth-child(1) {
        width: 18%;
    }

    .pen-pals-table th:nth-child(2) {
        width: 0;
        display: none;
    }

    .pen-pals-table td:nth-child(2) {
        display: none;
    }

    .pen-pals-table th:nth-child(3) {
        width: 62%;
    }

    .pen-pals-table th:nth-child(4) {
        width: 20%;
    }

    .pen-pal-name {
        font-size: 0.8rem;
    }

    .pen-pal-bio {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .pen-pal-date {
        font-size: 0.7rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .email-sender {
        display: none;
    }

    .email-content {
        font-size: 0.8rem;
    }

    .detail-subject {
        font-size: 1rem;
    }

    .compose-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .nav-item {
        font-size: 0.7rem;
        min-width: 50px;
    }
}

/* E-Pen Pals page */
.pen-pals-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pen-pals-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pen-pals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pen-pals-header-text {
    flex: 1;
}

.pen-pals-header h1,
.pen-pals-header h2 {
    font-size: 1.8rem;
    color: #202124;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.pen-pals-subtitle {
    font-size: 0.95rem;
    color: #5f6368;
    line-height: 1.5;
    max-width: 600px;
}

.pen-pals-signup-btn {
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pen-pals-signup-btn:hover {
    background-color: #1557b0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.pen-pals-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
}

.pen-pals-table thead {
    background-color: #f5f5f5;
}

.pen-pals-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 500;
    color: #5f6368;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
}

.pen-pals-table th:nth-child(1) {
    width: 20%;
}

.pen-pals-table th:nth-child(2) {
    width: 25%;
}

.pen-pals-table th:nth-child(3) {
    width: 40%;
}

.pen-pals-table th:nth-child(4) {
    width: 15%;
}

.pen-pals-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #202124;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pen-pals-table tr:last-child td {
    border-bottom: none;
}

.pen-pals-table tr:hover {
    background-color: #f8f9fa;
}

.pen-pal-name {
    font-weight: 500;
    color: #1a73e8;
}

.pen-pal-email {
    color: #5f6368;
}

.pen-pal-bio {
    line-height: 1.5;
    max-width: 500px;
}

.pen-pals-empty {
    text-align: center;
    padding: 3rem;
    color: #5f6368;
}

.pen-pals-empty p {
    margin-bottom: 1rem;
    font-size: 1rem;
}
