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

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

html, body {
    height: 100%;
    /* Use dvh for dynamic viewport height on mobile (handles address bar) */
    height: 100dvh;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100vw;
    overflow: hidden;
}

header {
    background-color: #fff;
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    z-index: 100;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px;
    gap: 12px;
    min-height: 0;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Icon button styles */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}

.icon-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    flex-shrink: 0;
}

#sessionInfoContainer {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sessionInfo {
    font-size: 13px;
    color: #666;
    background-color: #f0f0f0;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

#headerControls {
    display: flex;
    gap: 20px;
    align-items: center;
}

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

.control-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:hover {
    border-color: #007bff;
}

.control-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Role badge styles */
.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge.role-interviewer {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.role-badge.role-candidate {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}


button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#mainLayout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Tab Bar Styles */
#tabBar {
    display: flex;
    gap: 4px;
    background-color: #fff;
    padding: 8px 8px 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.tab-btn {
    padding: 10px 24px;
    background-color: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #e0e0e0;
}

.tab-btn.active {
    background-color: #fff;
    color: #007bff;
    box-shadow: 0 -2px 0 #007bff inset;
}

/* Tab Content Container */
#tabContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tab Panel Styles */
.tab-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

#codeCanvas,
#diagramCanvas {
    background-color: #fff;
    padding: 12px;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#codeCanvas h2,
#diagramCanvas h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Code Editor Header */
#codeEditorHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#codeEditorHeader h2 {
    margin-bottom: 0;
}

#languageSelector {
    display: flex;
    align-items: center;
    gap: 8px;
}

#languageSelector label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

#languageSelector select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

#languageSelector select:hover {
    border-color: #007bff;
}

#languageSelector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

#codeEditorWrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    min-height: 0;
}

#remoteCursor {
    position: absolute;
    width: 2px;
    background-color: rgba(255, 0, 0, 0.6);
    pointer-events: none;
    z-index: 1000;
    transition: all 0.1s ease;
}

#remoteCursor span {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 11px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

#codeInput,
#codeHighlight {
    margin: 0;
    padding: 12px;
    border: none;
    width: 100%;
    height: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    box-sizing: border-box;
}

#codeInput {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    color: transparent;
    background-color: transparent;
    caret-color: #333;
    resize: none;
    outline: none;
}

#codeHighlight {
    position: relative;
    z-index: 0;
    background-color: #f8f8f8;
    pointer-events: none;
}

#codeOutput {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

#diagramControls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

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

.tool-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.tool-btn {
    padding: 6px 12px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #f0f0f0;
    border-color: #007bff;
}

.tool-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

#colorPicker {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

#brushSize {
    width: 100px;
}

#brushSizeValue {
    font-size: 13px;
    color: #555;
    min-width: 20px;
}

#diagramArea {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    cursor: crosshair;
    touch-action: none; /* Prevent scrolling/zooming while drawing */
}

/* Messages FAB Button */
.messages-fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: calc(24px + env(safe-area-inset-right, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.messages-fab:hover {
    background-color: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.5);
}

.messages-fab:active {
    transform: scale(0.95);
}

.messages-fab svg {
    flex-shrink: 0;
}

/* Unread Badge */
.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background-color: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.unread-badge[hidden] {
    display: none;
}

.unread-badge.pulse {
    animation: badge-pulse 0.3s ease-out;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Messages Overlay */
.messages-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.messages-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Messages Panel */
.messages-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 60vh;
    max-height: 500px;
    background-color: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    /* Safe area padding for notched devices */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.messages-overlay.open .messages-panel {
    transform: translateY(0);
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.messages-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-messages-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.2s;
}

.close-messages-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

#messagesBlock {
    background-color: #fff;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#messagesList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    padding: 10px;
    border-radius: 6px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-interviewer {
    align-self: flex-start;
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.message-candidate {
    align-self: flex-end;
    background-color: #f3e5f5;
    border-left: 3px solid #9c27b0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.message-role {
    font-weight: 600;
    text-transform: capitalize;
}

.message-interviewer .message-role {
    color: #1976d2;
}

.message-candidate .message-role {
    color: #7b1fa2;
}

.message-timestamp {
    color: #666;
    font-size: 11px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

#messageInput {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

#messageText {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

#messageText:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#sendMessageBtn {
    padding: 10px 20px;
}


/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #fff;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-success .toast-icon {
    background-color: #d4edda;
    color: #28a745;
}

.toast-error .toast-icon {
    background-color: #f8d7da;
    color: #dc3545;
}

.toast-warning .toast-icon {
    background-color: #fff3cd;
    color: #856404;
}

.toast-info .toast-icon {
    background-color: #d1ecf1;
    color: #0c5460;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

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

.toast-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.toast-action {
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.toast-action:hover {
    background-color: #0056b3;
}

/* Retry Banner Styles */
.retry-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
}

.retry-banner.retry-failed {
    background-color: #f8d7da;
    border-color: #dc3545;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.retry-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.retry-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffc107;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.retry-failed .retry-spinner {
    display: none;
}

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

.retry-message {
    font-size: 14px;
    font-weight: 500;
    color: #856404;
}

.retry-failed .retry-message {
    color: #721c24;
}

.retry-attempt {
    font-size: 12px;
    color: #856404;
    opacity: 0.8;
}

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

.retry-cancel-btn,
.retry-manual-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-cancel-btn {
    background-color: transparent;
    border: 1px solid #856404;
    color: #856404;
}

.retry-cancel-btn:hover {
    background-color: #856404;
    color: white;
}

.retry-manual-btn {
    background-color: #dc3545;
    border: none;
    color: white;
}

.retry-manual-btn:hover {
    background-color: #c82333;
}

/* Sync Status Indicator Styles */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    vertical-align: middle;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sync-indicator.synced {
    background-color: #d4edda;
    color: #155724;
}

.sync-indicator.synced .sync-dot {
    background-color: #28a745;
}

.sync-indicator.syncing {
    background-color: #cce5ff;
    color: #004085;
}

.sync-indicator.syncing .sync-dot {
    background-color: #007bff;
    animation: pulse 1s infinite;
}

.sync-indicator.pending {
    background-color: #fff3cd;
    color: #856404;
}

.sync-indicator.pending .sync-dot {
    background-color: #ffc107;
}

.sync-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
}

.sync-indicator.error .sync-dot {
    background-color: #dc3545;
    animation: pulse 0.5s infinite;
}

.sync-indicator.offline {
    background-color: #e9ecef;
    color: #6c757d;
}

.sync-indicator.offline .sync-dot {
    background-color: #6c757d;
}

/* Compatibility Warning Banner */
.compatibility-warning {
    padding: 12px 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #721c24;
}

.compatibility-warning h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.compatibility-warning ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
}

.compatibility-warning li {
    margin-bottom: 4px;
}

/* Enhanced session info states */
#sessionInfo.status-connected {
    background-color: #d4edda !important;
    color: #155724 !important;
}

#sessionInfo.status-connecting {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

#sessionInfo.status-reconnecting {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

#sessionInfo.status-failed {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

#sessionInfo.status-disconnected {
    background-color: #f0f0f0 !important;
    color: #666 !important;
}

/* Tablet breakpoint - medium screens */
@media (max-width: 1024px) {
    header {
        padding: 10px 15px;
        gap: 10px;
    }

    header h1 {
        font-size: 20px;
    }

    main {
        padding: 10px;
        gap: 10px;
    }

    #mainLayout {
        gap: 10px;
    }

    #codeCanvas,
    #diagramCanvas {
        padding: 10px;
    }

    #diagramControls {
        gap: 8px;
        padding: 8px;
    }

    .tool-group {
        gap: 6px;
    }

    .messages-panel {
        width: 350px;
    }
}

/* Mobile breakpoint - standard phones */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
        gap: 8px;
    }

    header h1 {
        font-size: 18px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    #sessionInfoContainer {
        width: 100%;
    }

    #sessionInfo {
        font-size: 11px;
        padding: 4px 8px;
        word-break: break-all;
    }

    #headerControls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 8px;
    }

    .control-group {
        width: 100%;
    }

    .control-group label {
        min-width: 60px;
    }

    .control-group select {
        flex: 1;
        min-height: 40px;
    }

    main {
        padding: 8px;
        gap: 8px;
    }

    #mainLayout {
        gap: 8px;
    }

    #tabBar {
        padding: 6px 6px 0;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    #codeCanvas,
    #diagramCanvas {
        padding: 8px;
    }

    #codeCanvas h2,
    #diagramCanvas h2 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    #codeEditorHeader {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
    }

    #languageSelector {
        width: 100%;
    }

    #languageSelector select {
        flex: 1;
        min-height: 40px;
        font-size: 14px;
    }

    #codeInput,
    #codeHighlight {
        font-size: 13px;
        padding: 8px;
    }

    #diagramControls {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .tool-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .tool-group label {
        min-width: 45px;
        font-size: 12px;
    }

    .tool-btn {
        padding: 8px 12px;
        min-height: 40px;
        font-size: 13px;
    }

    #colorPicker {
        width: 44px;
        height: 40px;
    }

    #brushSize {
        flex: 1;
        min-width: 70px;
        height: 40px;
    }

    #diagramArea {
        touch-action: none;
    }

    /* Messages FAB and panel responsive */
    .messages-fab {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: calc(16px + env(safe-area-inset-right, 0px));
        width: 52px;
        height: 52px;
    }

    .messages-panel {
        width: 100%;
        height: 70vh;
        max-height: none;
        border-radius: 16px 16px 0 0;
    }

    .messages-header {
        padding: 12px;
    }

    .messages-header h2 {
        font-size: 16px;
    }

    #messagesList {
        padding: 8px;
    }

    .message {
        max-width: 90%;
        padding: 6px;
    }

    #messageInput {
        flex-direction: column;
        gap: 6px;
        padding: 8px;
    }

    #messageText {
        min-height: 40px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    #sendMessageBtn {
        width: 100%;
        min-height: 40px;
    }

    /* Toast responsive styles */
    .toast-container {
        left: 8px;
        right: 8px;
        top: 8px;
        max-width: none;
    }

    .toast {
        flex-wrap: wrap;
        padding: 10px;
    }

    .toast-action {
        margin-top: 6px;
        margin-left: auto;
    }

    /* Retry banner responsive */
    .retry-banner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 8px 12px;
    }

    .retry-content {
        justify-content: center;
    }

    .retry-actions {
        width: 100%;
        justify-content: center;
    }

    .retry-cancel-btn,
    .retry-manual-btn {
        min-height: 40px;
        padding: 8px 16px;
    }

    /* Sync indicator responsive */
    .sync-indicator .sync-text {
        display: none;
    }

    .sync-indicator {
        padding: 2px 5px;
    }
}

/* Small mobile breakpoint - small phones */
@media (max-width: 480px) {
    header {
        padding: 8px;
    }

    header h1 {
        font-size: 16px;
    }

    #sessionInfo {
        font-size: 10px;
    }

    main {
        padding: 6px;
        gap: 6px;
    }

    #codeCanvas,
    #diagramCanvas {
        border-radius: 6px;
        padding: 6px;
    }

    #codeInput,
    #codeHighlight {
        font-size: 12px;
        padding: 6px;
    }

    .tool-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .messages-fab {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
        width: 48px;
        height: 48px;
    }

    .messages-fab svg {
        width: 20px;
        height: 20px;
    }

    .message {
        font-size: 12px;
    }

    .message-header {
        font-size: 10px;
    }

    .message-text {
        font-size: 12px;
    }
}
