body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto; /* For horizontal centering within .main-content-area */
    background: #fff;
    padding: 30px; /* Consistent base padding */
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #2c3e50;
}
h1 {
    text-align: center;
    margin-bottom: 25px;
}

.input-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-section label {
    font-weight: bold;
}

.input-section input[type="url"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

button, .apply-btn {
    padding: 10px 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

button:hover, .apply-btn:hover {
    background-color: #2980b9;
}

#startAnalysisBtn.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#statusArea {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #eaf2f8;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

#progressBarContainer {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden; /* Ensures the progress bar stays within bounds */
}

#progressBar {
    width: 0%; /* Initial width */
    height: 20px;
    background-color: #3498db;
    text-align: center; /* For potential percentage text */
    line-height: 20px; /* Vertically center text */
    color: white;
    transition: width 0.4s ease;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

#resultsArea h3 {
    margin-top: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-left: 15px; /* Added to give headings more space from the left edge of this section */
}

.result-section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #fdfdfd;
}

.result-section label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #34495e;
}

.value-comparison {
    /* display: flex; // No longer needed if current-value is removed */
    /* gap: 15px; // No longer needed */
    margin-bottom: 10px;
}

.value-box { /* This class might be simplified or removed if only proposed-value remains */
    flex: 1; /* May not be needed if it's the only child */
    padding: 10px;
    border-radius: 4px;
    min-height: 50px; /* Ensure a minimum height */
}

.current-value { /* This class and its styles will be removed from HTML */
    background-color: #ecf0f1;
    border: 1px solid #dce4e6;
}
.current-value p { /* This will be removed from HTML */
    white-space: pre-wrap; /* Preserve formatting */
    word-wrap: break-word;
    margin-top: 5px;
    font-size: 0.95em;
}


.proposed-value textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    min-height: 50px; /* Start with a reasonable min-height */
    resize: none; /* Disable manual resizing if JS handles it */
    overflow-y: hidden; /* Hide scrollbar initially, JS will manage height */
    line-height: 1.5; /* Match typical line height for better calculation */
    margin-bottom: 10px; /* Space before the rendered output */
}

.rendered-markdown-output {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    min-height: 50px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Basic styling for common markdown elements */
.rendered-markdown-output h1,
.rendered-markdown-output h2,
.rendered-markdown-output h3,
.rendered-markdown-output h4,
.rendered-markdown-output h5,
.rendered-markdown-output h6 {
    margin-top: 0.5em;
    margin-bottom: 0.25em;
    line-height: 1.2;
    color: #2c3e50;
}
.rendered-markdown-output p {
    margin-bottom: 0.5em;
}
.rendered-markdown-output ul,
.rendered-markdown-output ol {
    padding-left: 20px;
    margin-bottom: 0.5em;
}
.rendered-markdown-output li {
    margin-bottom: 0.2em;
}
.rendered-markdown-output code {
    background-color: #ecf0f1;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "Courier New", Courier, monospace;
}
.rendered-markdown-output pre {
    background-color: #ecf0f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}
.rendered-markdown-output pre code {
    background-color: transparent;
    padding: 0;
}
.rendered-markdown-output blockquote {
    border-left: 3px solid #bdc3c7;
    padding-left: 10px;
    margin-left: 0;
    color: #7f8c8d;
}

.apply-btn {
    display: block;
    margin-top: 10px;
    background-color: #2ecc71;
}

.apply-btn:hover {
    background-color: #27ae60;
}

.action-btn {
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5a6268;
    border-color: #545b62;
}
 
.code-review-buttons {
    margin-top: 10px;
}

.code-review-buttons button {
    display: inline-block;
    margin-right: 10px;
}

.log-output {
    margin-top: 20px;
    padding: 10px;
    background-color: #2c3e50; /* Dark background for log */
    color: #ecf0f1; /* Light text */
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
}

/* Ensure the parent container of filesLogContent allows for structured content */
#savedFilesLogContainer pre { /* If filesLogContent was a pre, this might exist */
    white-space: normal; /* Allow wrapping if it was pre */
}

.files-log-list p {
    margin: 5px 0; /* Spacing between log entries */
    line-height: 1.4;
}
.files-log-list a {
    color: #e0e0e0; /* Light color for links on dark background */
    text-decoration: underline;
}
.files-log-list a:hover {
    color: #ffffff; /* Brighter on hover */
    text-decoration: none;
}

.log-output pre {
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word;
}


/* Credential Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    padding-top: 60px; /* Location of the box */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 60%;
    max-width: 700px; /* Max width */
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.modal-content h4 {
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Generic modal layout helpers */
.modal-row {
    margin: 10px 0;
}

.modal-actions {
    text-align: right;
    margin-top: 15px;
}

.muted-hint {
    color: #888;
    font-size: 0.9em;
}


.credential-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}
.credential-section:last-of-type {
    border-bottom: none;
}


.modal-content label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
}
.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="email"],
.modal-content input[type="url"] {
    width: 100%; /* Full width */
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* So padding doesn't add to width */
    font-size: 1em;
}
.modal-content textarea {
    width: 100%;
    min-height: 160px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: monospace;
    font-size: 0.95em;
    line-height: 1.4;
}
.credential-help {
    font-size: 0.85em;
    color: #555;
    margin-top: 3px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.credential-help a {
    color: #3498db;
    text-decoration: none;
}
.credential-help a:hover {
    text-decoration: underline;
}

.close-button {
    color: #aaa;
    position: absolute; /* Changed from float for better control */
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1; /* Ensure it aligns well */
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#saveCredentialsBtn {
    margin-top: 20px;
    padding: 12px 20px;
    background-color: #2ecc71; /* Green for save */
}
#saveCredentialsBtn:hover {
    background-color: #27ae60;
}
#saveCredentialsBtn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#credentialErrors.error-message {
    margin-bottom: 15px; /* Space before the first section if error is shown */
}

/* Styles for messages within the credential modal */
.modal-status-message {
    padding: 10px;
    margin-top: 15px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}

/* Ensure #credentialErrors can also be styled as a success message */
#credentialErrors.success-message {
    background-color: #d4edda; /* Light green background */
    color: #155724; /* Dark green text */
    border: 1px solid #c3e6cb; /* Green border */
}
/* .error-message class is already defined and will style #credentialErrors when it has that class */


/* Styles for the documentation view page (view_documentation.html) */
/* These can augment or override inline styles in view_documentation.html if needed */
/* For example, if you want to ensure consistency or manage more complex styles */

body.doc-view { /* Applied to body tag in view_documentation.html */
    background-color: #f8f9fa; /* A slightly different background for doc pages */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #212529;
    line-height: 1.6;
}

.doc-container { /* Main content wrapper for documentation */
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.3rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
}

.doc-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.doc-header h1 {
    font-size: 2.5rem;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.doc-header a {
    color: #007bff;
    text-decoration: none;
}
.doc-header a:hover {
    text-decoration: underline;
}

#markdown-content { /* The div where Markdown content is rendered */
    font-size: 1rem;
    line-height: 1.7;
}

#markdown-content h1,
#markdown-content h2,
#markdown-content h3,
#markdown-content h4,
#markdown-content h5,
#markdown-content h6 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    color: #343a40;
    font-weight: 600;
    line-height: 1.3;
}

#markdown-content h1 { font-size: 2.2rem; border-bottom: 2px solid #e9ecef; padding-bottom: 0.4em;}
#markdown-content h2 { font-size: 1.8rem; border-bottom: 1px solid #e9ecef; padding-bottom: 0.3em;}
#markdown-content h3 { font-size: 1.5rem; }
#markdown-content h4 { font-size: 1.25rem; }

#markdown-content p {
    margin-bottom: 1.2em;
}

#markdown-content ul, #markdown-content ol {
    margin-bottom: 1.2em;
    padding-left: 2em; /* Standard indentation for lists */
}

#markdown-content li {
    margin-bottom: 0.5em;
}

#markdown-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #c82333; /* A reddish color for inline code */
}

#markdown-content pre {
    background-color: #282c34; /* Darker background for code blocks */
    color: #abb2bf; /* Light text for dark background */
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
    line-height: 1.45;
}

#markdown-content pre code {
    background-color: transparent; /* Code inside pre should not have its own background */
    color: inherit; /* Inherit color from pre */
    padding: 0;
    font-size: inherit;
}

#markdown-content a {
    color: #0056b3;
    text-decoration: underline;
}
#markdown-content a:hover {
    color: #003d80;
}

#markdown-content blockquote {
    border-left: 5px solid #adb5bd;
    padding-left: 1.5em;
    margin-left: 0;
    margin-bottom: 1.2em;
    color: #495057;
    font-style: italic;
}

#markdown-content table {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
}

#markdown-content th, #markdown-content td {
    padding: 0.75rem;
    vertical-align: top;
    border: 1px solid #dee2e6;
}

#markdown-content th {
    font-weight: 600;
    background-color: #f8f9fa;
}

#markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* --- History Panel Styles --- */
body.history-layout { /* Added body selector for specificity as per typical use */
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

#historyPanel { /* Was .history-panel, now matches ID from HTML */
    padding: 20px;
    box-sizing: border-box;
    /* Other properties like background, height, overflow are now on #historyPanelContainer */
}

.history-panel h2 {
    margin-top: 0;
    font-size: 1.3em; /* Slightly smaller than main H2 */
    color: #343a40; /* Darker, more prominent heading */
    border-bottom: 1px solid #ced4da;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#historyList {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.history-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0; /* Softer border */
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 15px;
    margin-bottom: 10px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* Needed for positioning the delete button */
}

.history-item:hover {
    background-color: #f9f9f9; /* Slightly different hover */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.history-item:last-child {
    /* border-bottom: none; /* Not needed if full border is applied */
    /* margin-bottom: 0; /* Keep margin for consistency if panel scrolls */
}

/* New structure for history item content */
.history-item-title {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50; /* Dark, prominent */
    margin-bottom: 6px;
    line-height: 1.3;
}

.history-item-title .history-item-update {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    font-size: 0.7em;
    font-weight: 700;
    color: #0f4c81;
    background-color: #dde5ff;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-item-title .history-item-update-btn {
    margin-left: 10px;
    padding: 2px 10px;
    font-size: 0.7em;
    border-radius: 12px;
    border: 1px solid #3c6df0;
    background-color: #3c6df0;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.history-item-title .history-item-update-btn:hover {
    background-color: #2f55c7;
    border-color: #2f55c7;
}

.history-item-url {
    font-size: 0.85em;
    color: #3498db; /* Standard link blue */
    margin-bottom: 4px;
    word-break: break-all; /* Prevent overflow */
    display: block; /* Ensure it takes its own line */
}
.history-item-url a {
    color: inherit;
    text-decoration: none;
}
.history-item-url a:hover {
    text-decoration: underline;
}

.history-item-timestamp {
    font-size: 0.8em;
    color: #7f8c8d; /* Muted color */
    margin-bottom: 10px; /* Space before buttons */
    display: block; /* Ensure it takes its own line */
}

.history-item-auto-status {
    font-size: 0.8em;
    margin-bottom: 8px;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #eef2ff;
    color: #3949ab;
}

.history-item-auto-status.success {
    background-color: #e6f4ea;
    color: #1b5e20;
}

.history-item-auto-status.error {
    background-color: #fdecea;
    color: #c62828;
}

.history-item-auto-status.warning {
    background-color: #fff4e5;
    color: #ef6c00;
}

.history-item-auto-status.neutral {
    background-color: #f2f2f2;
    color: #5f6368;
}

.history-item-buttons {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.history-item button { /* General style for buttons inside items */
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent; /* Base border */
    font-weight: 500;
}

/* Specific button styles */
.load-history-btn {
    background-color: #3498db; /* Blue */
    color: white;
    border-color: #3498db;
}
.load-history-btn:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.refresh-history-btn {
    background-color: #2ecc71; /* Green */
    color: white;
    border-color: #2ecc71;
}
.refresh-history-btn:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}


.main-content-area {
    flex-grow: 1;
    /* display: flex; justify-content: center; align-items: flex-start; /* Removed as per new layout, centering handled by .container's margin: auto */
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
    padding: 0; /* Padding is handled by .container inside */
    /* transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out; /* Removed, not specified for new layout */
}

#appHeader {
    padding: 10px 30px; /* Align with .container padding */
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    box-sizing: border-box; /* Good practice */
}

/* Responsive adjustments */
@media (max-width: 992px) { /* Adjust breakpoint if needed */
    .history-panel {
        width: 280px; /* Slightly narrower for medium screens */
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .history-layout {
        flex-direction: column;
    }
    .history-panel {
        width: 100%;
        height: auto;
        max-height: 45vh; /* Slightly more height for history on mobile */
        position: static;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        box-shadow: none; /* Remove shadow in column layout */
    }
    .main-content-area > .container {
        height: auto; /* Allow content to define height */
        overflow-y: visible; /* No separate scroll for main content */
        padding-top: 20px; /* Add some space from history panel */
    }
}
/* --- History Panel Toggle Styles --- */
#historyPanelContainer {
    width: 320px;
    flex-shrink: 0;
    background-color: #f8f9fa;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    border-right: 1px solid #dee2e6;
    /* transition: width 0.3s ease-in-out, min-width 0.3s ease-in-out; /* This transition might conflict with display:none logic */
}

.history-toggle-btn {
    background-color: #6c757d; /* A neutral, secondary color */
    color: white;
    border: none;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    border-radius: 4px; /* Fully rounded as a standalone button */
    margin-bottom: 10px; /* Increased space between button and H1 title */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
    /* position: absolute; */ /* If you want it to overlay or be fixed relative to panel */
    /* top: 10px; */
    /* left: 100%; */ /* Start it outside the panel when panel is visible */
    /* transform: translateX(-100%); */ /* Pull it back in */
    /* z-index: 10; */ /* No longer needed in normal flow */
    transition: background-color 0.2s ease;
}

.history-toggle-btn:hover {
    background-color: #5a6268;
}

.history-toggle-btn.active-link {
    background-color: #2ecc71;
}

.history-toggle-btn.active-link:hover {
    background-color: #27ae60;
}

/* Collapsed state for the history panel container */
#historyPanelContainer.history-panel-collapsed {
    width: 0;
    min-width: 0; /* Allow it to fully collapse during transition */
    display: none; /* Hide completely */
    overflow: hidden; /* Hide content when collapsed, useful during transition before display:none */
}

/* When panel is collapsed, the toggle button might need different styling if it's visible */
#historyPanelContainer.history-panel-collapsed .history-toggle-btn {
    /* Adjust if the button is meant to be visible and clickable when panel is collapsed */
    /* For example, position it fixed or differently */
    border-radius: 4px; /* Full rounding if it's standalone */
}

.logout-form {
    display: inline-block;
    margin-bottom: 10px;
}

.logout-form .history-toggle-btn {
    margin-left: 0;
    display: inline-flex;
}


/* Removed duplicate .main-content-area definition. Styles merged into the first instance. */

.main-content-area.full-width {
    /* This class is likely no longer needed for layout adjustments
       when #historyPanelContainer uses display:none, as .main-content-area
       with flex-grow: 1 will automatically expand.
       The properties 'width: 100%' and 'margin-left: 0' are now redundant.
       display:flex, justify-content, align-items:flex-start were already removed/commented.
    */
}

/* Responsive adjustments for toggle button if needed */
@media (max-width: 768px) {
    .history-toggle-btn {
        /* Full width or different positioning on mobile */
        width: 100%;
        border-radius: 4px; /* Full rounding */
        text-align: center;
        margin-bottom: 10px;
    }

    #historyPanelContainer {
        flex-direction: column; /* Stack toggle and panel */
    }

    #historyPanelContainer.history-panel-collapsed {
        height: auto; /* Adjust height for the button only */
    }
    
    .main-content-area.full-width {
        /* Ensure it behaves correctly in column layout */
    }
}

.delete-button {
    background-color: #e74c3c; /* Red color */
    color: white;
    border-color: #e74c3c;
}

.delete-button:hover {
    background-color: #c0392b; /* Darker red on hover */
    border-color: #c0392b;
}

/* Styles for Address Review Page (address_review.html) */
.comments-bubbles-container {
    margin-top: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-bubble {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.comment-bubble:hover {
    border-color: #3498db;
    background-color: #f0f8ff; /* Light blue on hover */
}

.comment-bubble.selected {
    background-color: #eaf2f8; /* A light blue to indicate selection */
    border-left: 5px solid #3498db;
    padding-left: 12px; /* Adjust padding to account for border */
}

.comment-author {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.comment-body {
    font-size: 0.9em;
    line-height: 1.5;
    color: #333;
    margin-bottom: 8px;
    white-space: pre-wrap; /* Preserve line breaks from comment body */
    word-wrap: break-word;
}

.comment-placement {
    font-size: 0.8em;
    color: #7f8c8d;
    font-style: italic;
}

#status-area-address-review,
#error-area-address-review {
    margin-top: 15px;
    margin-bottom: 15px;
}

#comments-loading-message {
    font-style: italic;
    color: #555;
    padding: 15px;
    text-align: center;
}

.action-buttons-bottom {
    text-align: center; /* Center the button */
    margin-top: 20px;
}

#create-prompt-btn {
    background-color: #2ecc71; /* Green for create/action */
    padding: 12px 25px;
    font-size: 1.05em;
}
#create-prompt-btn:hover {
    background-color: #27ae60;
}
#addressReviewBtn {
    color: white;
}

#prompt-status-message.status-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

#prompt-status-message.error-message {
    /* Uses existing .error-message styles */
    text-align: center;
}

.nav-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
}
.nav-link:hover {
    text-decoration: underline;
}

/* Styles for auth.html */
.auth-form .form-group {
    margin-bottom: 15px; /* Space between form groups */
}

.auth-form label {
    display: block; /* Make labels take full width */
    margin-bottom: 5px; /* Space between label and input */
    font-weight: bold;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%; /* Make inputs take full width */
    padding: 10px;
    box-sizing: border-box; /* Include padding in width calculation */
    border: 1px solid #ccc;
    border-radius: 4px;
}

.auth-buttons {
    margin-top: 25px; /* Increased top margin for separation */
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px; /* Space between buttons */
    align-items: center; /* Center buttons horizontally */
}

.btn-login, .btn-register {
    width: 100%; /* Make buttons take full width of their container */
    max-width: 300px; /* Optional: constrain max width for very wide screens */
    box-sizing: border-box;
}

.btn-login {
    padding: 12px 25px !important; /* Use !important to override general button padding if needed */
    font-size: 1.1em !important; /* Use !important to override general button font-size if needed */
    background-color: #3498db; /* Explicitly blue, though it's default */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: #2980b9; /* Darker blue on hover */
}

.btn-register {
    padding: 10px 18px !important; /* Standard button padding or adjust as needed */
    font-size: 1em !important;    /* Standard button font-size or adjust */
    background-color: #ecf0f1; /* Light grey */
    color: #34495e;            /* Darker grey/blue text */
    border: 1px solid #bdc3c7; /* Light border */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-register:hover {
    background-color: #dadedf; /* Slightly darker grey on hover */
    border-color: #a5acaf;
}
/* Google Sign-In button (brand-like) */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    padding: 10px 16px;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.btn-google:hover {
    background-color: #f8fafe;
    border-color: #c6dafc;
}

.btn-google svg {
    width: 18px;
    height: 18px;
    display: block;
}

.auth-buttons-google {
    margin-top: 12px;
}

/* General status messages, can be used on auth.html and other pages */
.status-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid transparent;
}

.status-message.success-message { /* For successful registration, etc. */
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status-message.error-message { /* For login errors, user exists, etc. */
    background-color: #f8d7da;
   color: #721c24;
   border-color: #f5c6cb;
}

.status-message.warning-message {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.status-message.info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Admin Page Styles */
.admin-users-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 0.95em; /* Slightly smaller font for table data */
}

.admin-users-table th,
.admin-users-table td {
    padding: 12px 15px; /* Increased padding */
    text-align: left;
    border-bottom: 1px solid #e0e0e0; /* Light border for rows */
}

.admin-users-table th {
    background-color: #f8f9fa; /* Light grey background for headers */
    font-weight: 600; /* Bolder header text */
    color: #343a40;
}

.admin-users-table .actions-header-cell {
    text-align: center; /* Center "Actions" header */
}

.admin-users-table tr:last-child td {
    border-bottom: none; /* Remove border from last row */
}

.admin-users-table .status-cell {
    text-align: center; /* Center "Verified" status */
    font-weight: 500;
}

.admin-users-table .status-subnote {
    font-size: 0.85em;
    margin-top: 4px;
}

.admin-users-table .status-cell.verified-yes {
    color: #28a745; /* Green for "Yes" */
}

.admin-users-table .status-cell.verified-no {
    color: #dc3545; /* Red for "No" */
}

.admin-users-table .actions-cell {
    /* min-width: 350px; /* Ensure enough space for actions, adjust as needed */
}

.admin-action-form {
    display: flex;
    flex-direction: column; /* Stack password and management actions vertically */
    gap: 10px; /* Space between password section and management actions */
}

.password-section {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between input and button */
    margin-bottom: 10px; /* Space below password section if management actions follow */
}

.password-section input[type="text"] {
    flex-grow: 1; /* Allow input to take available space */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 120px; /* Minimum width for password input */
}

.user-management-actions {
    display: flex;
    gap: 8px; /* Space between management buttons */
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens if needed */
}

.admin-users-table button { /* General button styling within the table */
    padding: 7px 12px; /* Slightly smaller padding for table buttons */
    font-size: 0.85em; /* Slightly smaller font */
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-change-pass {
    background-color: #007bff; /* Blue */
    color: white;
    border-color: #007bff;
}
.btn-change-pass:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-verify {
    background-color: #2ecc71; /* Green */
    color: white;
    border-color: #2ecc71;
}
.btn-verify:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-unverify {
    background-color: #f39c12; /* Orange */
    color: white;
    border-color: #f39c12;
}
.btn-unverify:hover {
    background-color: #e67e22;
    border-color: #e67e22;
}

/* .delete-button class is already defined with red styling */
.btn-delete { /* Ensure it picks up general table button padding if not already */
    /* padding: 7px 12px; */ /* Already covered by .admin-users-table button */
}
/* Styles for editable sections feature */
.proposed-value textarea.editable-textarea { /* More specific selector if needed for textareas meant to be editable */
    /* display: none; */ /* Initially hidden by inline style, CSS can be a fallback or primary control */
}

.save-section-btn {
    /* display: none; */ /* Initially hidden by inline style */
    background-color: #2ecc71; /* Green for save */
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 8px; /* Space above the button */
    transition: background-color 0.3s ease;
}

.save-section-btn:hover {
    background-color: #27ae60; /* Darker green on hover */
}

.save-section-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.editable-rendered-output {
    cursor: pointer;
    border: 1px dashed #ccc;
    padding: 8px; /* Increased padding for better clickability and appearance */
    min-height: 30px; /* Ensure it's clickable even when empty */
    border-radius: 4px; /* Slightly rounded corners */
    transition: border-color 0.3s ease, background-color 0.3s ease; /* Smooth transition for hover effect */
    margin-bottom: 5px; /* Space below rendered output before save button if textarea is hidden */
}

.editable-rendered-output:hover {
    border-color: #3498db; /* Highlight border on hover */
    background-color: #f0f8ff; /* Slight background change on hover */
}

/* Ensure textareas are visible when they are supposed to be (JS will manage this) */
.proposed-value textarea[data-section-key] {
    /* Default styles for textareas are already present.
       JS will toggle display:none/block.
       This class is mainly for consistency if we need to target them.
    */
}
/* Back link on inline review page */
.back-link {
    display: block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
    text-align: center;
}

.back-link:hover {
    text-decoration: underline;
}
/* Styles for the 'Remove Unnecessary Comments' result container */
#result-container pre {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Delete button for history items */
.delete-history-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background-color: #e74c3c; /* Red */
    color: white;
    border-radius: 50%; /* Circular shape */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    opacity: 0; /* Initially hidden */
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.history-item:hover .delete-history-btn {
    opacity: 1; /* Show on hover */
    visibility: visible;
}

.delete-history-btn:hover {
    background-color: #c0392b; /* Darker red on hover */
}
/* Full-row underline for the results header and proper button alignment */
.results-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 10px;
}
.results-header h2 {
    border-bottom: none;
    padding-bottom: 0;
}
.results-header .apply-btn {
    display: inline-block;
    margin-top: 0;
}
/* Repo-specific instruction card (Address Review) */
.repo-instruction-card {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f9fbfc;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.repo-instr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 0.95em;
}

.repo-instr-row input[type="checkbox"] {
    accent-color: #2ecc71; /* match green CTA */
    width: 16px;
    height: 16px;
}

.repo-instruction-textarea {
    width: 100%;
    min-height: 56px;
    max-height: 240px;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
    resize: none; /* autogrow is handled by JS */
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, height .1s ease;
}

.repo-instruction-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}

.review-instructions-field {
    width: 100%;
    min-height: 180px;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    background-color: #fff;
}

.review-instructions-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}

/* --- AI Portal styles --- */
.ai-portal-container {
    max-width: 760px;
    margin: 0 auto;
}

.ai-portal-title {
    margin-bottom: 12px;
    text-align: left;
}

.ai-portal-lede {
    margin-bottom: 24px;
    color: #4d5c6e;
    font-size: 1rem;
    line-height: 1.6;
}

.ai-portal-card {
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
}

.ai-portal-video-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-portal-card--video {
    padding: 20px;
}

.ai-portal-card__header--video {
    align-items: center;
}

.tutorial-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.tutorial-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#tutorialVideoShowBtn {
    align-self: flex-start;
}

.ai-portal-card--error {
    border-color: #f5c6cb;
    background: #fff5f5;
}

.ai-portal-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-project-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 9999px;
    background: #e8f3ff;
    color: #1f6feb;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ai-portal-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-top: 18px;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 18px;
}

.status-icon--success {
    color: #2ecc71;
}

.status-icon--warning {
    color: #f39c12;
}

.status-icon--muted {
    color: #94a3b8;
}

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

.apply-btn.secondary {
    background-color: #56657f;
}

.apply-btn.secondary:hover {
    background-color: #455271;
}

.apply-btn.tiny {
    padding: 6px 12px;
    font-size: 0.8rem;
    line-height: 1.2;
}

.ai-portal-footnote {
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: #5b6b7f;
}

.ai-portal-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.ai-portal-message.success-message {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
    display: block;
}

.ai-portal-message.error-message {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    display: block;
}

.ai-key-value-panel {
    border: 1px dashed #38bdf8;
    background: #f0f9ff;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.ai-key-value-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ai-key-value {
    display: block;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #cce6ff;
    font-size: 1rem;
    word-break: break-all;
}

@media (max-width: 640px) {
    .ai-portal-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-portal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-key-value-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
