
body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    background-color: #f4f0e8; /* Light parchment paper */
    color: #4a3b31; /* Darker brown text */
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}



/* Rustic Scroll/Parchment Background Idea */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    background-image:
        linear-gradient(to bottom right, rgba(239, 220, 187, 0.1) 25%, transparent 25%, transparent 75%, rgba(239, 220, 187, 0.1) 75%, rgba(239, 220, 187, 0.1)),
        linear-gradient(to bottom right, rgba(210, 180, 140, 0.05) 25%, transparent 25%, transparent 75%, rgba(210, 180, 140, 0.05) 75%, rgba(210, 180, 140, 0.05));
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #f5e8c7;
}


.campaign-item {
    background-color: #ffecc0; /* Light parchment color */
    border: 1px solid #d2b48c; /* Tan border */
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-right: 2.5rem;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.campaign-item:hover {
    background-color: #ffe7ae; /* Slightly darker on hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.campaign-item::marker {
    color: #5c403300; /* Dark wood brown for list markers */
}

.open-source-link {
    color: #3a8ec2; /* Light blue text */
}


.top-bar {
    background-color: #5c4033; /* Dark wood brown */
    color: #f5e8c7; /* Parchment text */
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-bottom: 3px solid #8a5a2c; /* Slightly lighter wood accent */
    height: 5rem;
    z-index: 10000;
}



#logo {
    font-family: 'Merriweather', serif;
    font-size: 1.8em;
    font-weight: 700;
    display: flex;
    flex-direction: row;
    cursor: pointer;
}

#hamburger {
    font-size: 1.5em;
    margin: 0;
    margin-right: 20px;
    align-self: center;
    color: #f5e8c7; /* Parchment text */
}




#settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    height: 20em;
    width: 25em;
    top: -14em;
    left: 0;
    transition: top 0.3s ease;
    z-index: 9999;
    background-color: rgba(245, 232, 199, 0.85);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border: 1px solid #d2b48c;
    border-radius: 0 0 8px 0;
}



#settings.expanded {
    top: 6.5em; /* Show settings when expanded */
}

.settings-header {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    font-weight: bold;
    align-items: center;
    transition: all 0.3s ease;
}

.settings-header p {
    font-size: 2em;
    margin: 0 auto;
}

.settings-item {
    width: 70%;
    height: 3.25rem;
    padding-left: 20%;
    padding-right: 10%;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
    transition: all 0.3s ease;
}

.settings-item p {
    position: absolute;
    font-size: 1.2em;
    margin-left: 7rem;
    margin-top: 0.25rem;
    cursor: default;
    font-weight: bold;
}

.settings-item:hover {
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}






.toggle {
	position: relative;
	display: inline-block;
	width: 4em;
	height: 2.5em;
}

.toggle input {
	display: none;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #444444;
	transition: 0.4s;
	border-radius: 3em;
}

.slider:before {
	position: absolute;
	content: "";
	height: 2.25em;
	width: 2.25em;
	left: 0.125em;
	bottom: 0.125em;
	background-color: #FFFFFF;
	transition: all 0.2s ease;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: #3a8ec2;
}

input:checked + .slider:before {
	transform: translateX(1.5em);
}




.top-bar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.top-bar nav ul li {
    margin-left: 20px;
}

.top-bar nav ul li a {
    color: #f5e8c7;
    text-decoration: none;
    font-size: 1em;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.top-bar nav ul li a:hover {
    background-color: #8a5a2c; /* Lighter wood hover */
    color: #fff;
}

.top-bar nav ul li a.active {
    /*font-weight: bold;*/
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    color: #f0e68c; /* Khaki - slight highlight for active */
}

.container {
    width: 80%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(245, 232, 199, 0.85); /* Semi-transparent parchment content area */
    border: 1px solid #d2b48c; /* Tan border */
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    flex-grow: 1;
}



h1 {
    font-family: 'Merriweather', serif;
    color: #5c4033; /* Dark wood brown */
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #8a5a2c;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: 'Merriweather', serif;
    font-size: 1.1em;
    margin-bottom: 0.5rem;
    color: #5c4033;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #b08d57; /* Rustic gold/brown border */
    border-radius: 4px;
    background-color: #fffaf0; /* Creamy white */
    font-family: 'Lato', sans-serif;
    font-size: 1em;
    color: #3a2410;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #8a5a2c; /* Darker focus border */
    box-shadow: 0 0 5px rgba(138, 90, 44, 0.3);
    outline: none;
}

textarea {
    resize: vertical;
}

.btn {
    background-color: #6b4f41; /* Muted brown button */
    color: #f5e8c7;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: 'Merriweather', serif;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border-bottom: 2px solid #4a3b31;
}

.btn:hover {
    background-color: #8a5a2c; /* Lighter brown on hover */
    transform: translateY(-2px);
}

.btn:active {
    background-color: #4a3b31;
    transform: translateY(0);
}

.btn-secondary {
    background-color: #a0a0a0; /* Grey for secondary action */
    color: #333;
    border-bottom-color: #707070;
}
.btn-secondary:hover {
    background-color: #b0b0b0;
}
.btn-secondary:active {
    background-color: #808080;
}


.save-status {
    margin-top: 1rem;
    font-style: italic;
    color: #38761d; /* Muted green for success */
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Darker overlay */
}

.modal-content {
    background-color: #f5e8c7; /* Parchment */
    margin: 15% auto;
    padding: 30px;
    border: 2px solid #8a5a2c; /* Wood-like border */
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    font-family: 'Merriweather', serif;
    color: #5c4033;
}

.modal-content h2 {
    margin-top: 0;
    color: #5c4033;
}

.close-button {
    color: #777;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s;
}

.close-button:hover,
.close-button:focus {
    color: #3a2410; /* Dark brown */
    text-decoration: none;
    cursor: pointer;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

footer {
    background-color: #3e2e24; /* Darkest brown for footer */
    color: #c5b8a5; /* Light tan text */
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9em;
    margin-top: auto; /* Pushes footer to the bottom */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        padding: 1rem;
    }
    .top-bar nav ul {
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
    }
    .top-bar nav ul li {
        margin: 0.5rem 0;
    }
    .container {
        width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        margin-bottom: 10px;
    }
}


/* Party Management Page Styles - Compact Adjustments */
/* Expansion Fix: Refined transition for details */
.party-member-details {
    padding-left: 15px;  /* Horizontal padding always present */
    padding-right: 15px;
    padding-top: 0;      /* Vertical padding initially 0 */
    padding-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out, padding-bottom 0.35s ease-out; /* Smooth transition for height and vertical padding */
    
    /* Compact UI adjustments from previous step */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.party-member-card.expanded .party-member-details {
    max-height: 1200px; /* Increased max-height to ensure all content fits */
    padding: 10px 15px; /* Ensure padding is applied on expand */
}

.party-member-details .form-group {
    margin-bottom: 0;
}

.party-member-details label {
    font-size: 0.85em; /* Smaller label font size */
    color: #6b4f41;
    margin-bottom: 3px; /* Less space below label */
    display: block;
}

/* Targeting inputs specifically within party member details for compactness */
.party-member-details input[type="text"],
.party-member-details input[type="number"],
.party-member-details select,
.party-member-details textarea {
    padding: 0.5rem 0.6rem; /* Reduced padding inside inputs */
    font-size: 0.9em; /* Smaller font size in inputs */
    /* width: 100%; already handled by general input styles, but good to keep in mind */
}

.party-member-details textarea {
    min-height: 50px; /* Smaller default height for textarea */
}

/* Styles for the inline action buttons within the details section */
.party-member-inline-actions {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    align-items: center;
    gap: 10px; /* Space between buttons */
    margin-top: 10px; /* A little space above the buttons */
    grid-column: 1 / -1; /* Make this div span full width */
}

.party-member-inline-actions .btn {
    padding: 0.4rem 0.8rem; /* Smaller buttons */
    font-size: 0.85em;
}

.btn-delete-member { 
    background-color: #a0522d;
    color: white;
}
.btn-delete-member:hover {
    background-color: #80381a;
}



.party-member-card {
    background-color: #fdfaf3; 
    border: 1px solid #c8a064; 
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.party-member-header {
    background-color: #D1C0A8; 
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0cba8; 
    border-top-left-radius: 5px;    
    border-top-right-radius: 5px;
}

.party-member-header h3 {
    margin: 0;
    font-family: 'Merriweather', serif;
    color: #5c4033;
}

.party-member-header .expand-icon {
    font-weight: bold;
    font-size: 1.2em;
    transition: transform 0.35s ease;
    margin-left: 10px;
}

.party-member-card.expanded .expand-icon {
    transform: rotate(90deg);
}



.party-member-card.expanded .party-member-details {
    max-height: 1500px; 
    padding-top: 10px;   
    padding-bottom: 15px; 
}

.party-member-details .form-group {
    margin-bottom: 0;
}

.party-member-details label {
    font-size: 0.85em;
    color: #6b4f41;
    margin-bottom: 3px;
    display: block;
}

.party-member-details input[type="text"],
.party-member-details input[type="number"],
.party-member-details select,
.party-member-details textarea {
    padding: 0.5rem 0.6rem;
    font-size: 0.9em;
}

.party-member-details textarea {
    min-height: 50px;
}

.party-member-inline-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    grid-column: 1 / -1;
}

.party-member-inline-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85em;
}




.btn-danger {
    background-color: #c0392b; /* A rustic red */
    color: #f5e8c7; /* Light text for contrast */
    border-bottom-color: #962d22;
}
.btn-danger:hover {
    background-color: #a93226;
}
.btn-danger:active {
    background-color: #922b21;
}



/* Styles for Creature Generator Page */
.creature-form-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

#creatureForm {
    flex: 3; /* Form takes more space */
}

#suggestionsPanel {
    flex: 1; /* Suggestions panel takes less space */
    background-color: #D1C0A8; /* Slightly different background */
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #d2b48c;
    
    position: sticky;
    top: 80px; 
    max-height: calc(100vh - 100px); 
    overflow-y: auto;
}

#suggestionsPanel h2 {
    margin-top: 0;
    font-family: 'Merriweather', serif;
    color: #5c4033;
    font-size: 1.3em;
    border-bottom: 1px solid #8a5a2c;
    padding-bottom: 5px;
}

#suggestionsContent ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.9em;
}
#suggestionsContent li {
    margin-bottom: 5px;
}
#suggestionsContent li strong {
    color: #5c4033;
}

#creatureForm fieldset {
    border: 1px solid #d2b48c;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(245, 232, 199, 0.3);
}

#creatureForm legend {
    font-family: 'Merriweather', serif;
    font-weight: bold;
    color: #5c4033;
    padding: 0 10px;
    font-size: 1.2em;
}

.custom-stat-input {
    margin-left: 10px;
    width: auto; /* Allow it to be smaller */
    max-width: 150px;
}

.stat-value-display {
    margin-left: 10px;
    font-weight: bold;
    color: #3a2410;
}

.btn-small { /* For random name button */
    padding: 0.3rem 0.6rem;
    font-size: 0.8em;
    margin-left: 10px;
}

#magicalStatsContainer {
    border-left: 3px solid #8a5a2c;
    padding-left: 15px;
    margin-top: 10px;
    margin-left: 5px; /* Indent magical stats slightly */
}

/* Diagnostics Panel Styles */
#diagnosticsPanel {
    background-color: rgba(224, 214, 196, 0.7); /* Slightly different, distinct background with some transparency */
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #c8a064; /* Consistent with other panel borders */
    margin-top: 20px; 
    margin-bottom: 20px; 
    display: flex;
    gap: 15px;
    min-height: 160px;
    position: sticky;
    bottom: 30px; /* Adjust so it's above the save button area */
    z-index: 900; /* Below modals but above general content */
}

.diagnostics-column {
    padding: 5px;
}

.diagnostics-graph-area {
    flex: 1; /* Takes 1/3 of the space */
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 150px; /* Ensure some minimum width for the graph */
}

.diagnostics-info-area {
    flex: 2; /* Takes 2/3 of the space */
    font-size: 0.9em;
    color: #4a3b31;
}
.diagnostics-info-area h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #5c4033; /* Dark wood brown */
    font-family: 'Merriweather', serif;
}
.diagnostics-info-area p {
    margin: 0;
}
.diagnostics-info-area span {
    font-weight: bold;
    color: #3a2410; /* Darker brown for values */
}


#diagnosticsHexagonSVG {
    width: 100%;
    max-width: 150px; /* Max size of the SVG element */
    height: auto;    /* Maintain aspect ratio */
}

.hexagon-background {
    fill: rgba(240, 230, 209, 0.7); /* Lighter parchment shade for hex background */
    stroke: #8a5a2c; /* Wood-like border */
    stroke-width: 1.5; /* Slightly thicker for visual presence */
}

.stats-triangle-shape {
    fill: rgba(92, 64, 51, 0.55); /* Semi-transparent dark fill for the triangle */
    stroke: #3E2E24; /* Darker border for triangle */
    stroke-width: 1;
    transition: points 0.3s ease-in-out; /* Smooth transition for points change */
}

.diag-label {
    font-family: 'Merriweather', serif;
    font-size: 10px; /* Adjusted for visibility within SVG */
    fill: #5c4033;
    z-index: 1000; /* Ensure labels are above the triangle */
}


/* Responsive adjustments if needed */
@media (max-width: 900px) { 
    .creature-form-layout {
        flex-direction: column;
    }
    #creatureForm, #suggestionsPanel {
        flex: none;
    }
    #diagnosticsPanel {
        flex-direction: column; /* Stack graph and info vertically on smaller screens */
        align-items: center; /* Center items when stacked */
    }
    .diagnostics-graph-area {
        margin-bottom: 15px;
    }
    .diagnostics-info-area {
        text-align: center; /* Center text when stacked */
    }
}


/* --- Styles for Homebrew Catalog Page --- */

.catalog-controls-bar {
    display: flex;
    justify-content: flex-start; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px; 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #d2b48c;
}

.add-asset-container {
    position: relative; 
    display: inline-block; 
    margin-bottom: 0; 
}

.custom-dropdown-menu {
    display: none; 
    position: absolute;
    top: 100%; 
    left: 0;
    background-color: #fdfaf3; 
    border: 1px solid #c8a064;
    border-radius: 0 0 6px 6px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 100; 
    min-width: 200px; 
}

.custom-dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #5c4033;
    text-decoration: none;
    border-bottom: 1px solid #e0cba8; 
}
.custom-dropdown-menu a:last-child {
    border-bottom: none;
}
.custom-dropdown-menu a:hover {
    background-color: #D1C0A8; 
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px; 
}
.sort-controls label {
    font-weight: bold;
    color: #5c4033;
    font-size: 0.9em; 
    margin-bottom: 0; 
    width: 5.8em;
}
.sort-controls select {
    padding: 0.3rem 0.5rem; 
    font-size: 0.9em; 
    border-radius: 4px;
    border: 1px solid #b08d57;
    background-color: #fffaf0;
}
.sort-controls .btn-small { 
    padding: 0.3rem 0.5rem; 
    font-size: 0.9em; 
    line-height: 1.2; 
}

.filter-panel-top {
    background-color: transparent; 
    padding: 5px 10px; 
    border-radius: 6px;
    border: 1px solid #d2b48c; 
}

.filter-panel-top h2 {
    margin-top: 0;
    margin-bottom: 5px; 
    font-family: 'Merriweather', serif;
    color: #5c4033;
    font-size: 0.95em; 
    border-bottom: none; 
    padding-bottom: 0;
    display: inline-block; 
    margin-right: 10px; 
}

.filter-panel-top .filter-options-container {
    display: flex; 
    gap: 10px;     
    flex-wrap: wrap;
    align-items: center; 
}

.filter-panel-top .filter-group {
    margin-bottom: 0; 
    display: flex; 
    align-items: center;
}
.filter-panel-top .filter-group label {
    margin-left: 3px; 
    color: #4a3b31;
    font-size: 0.85em; 
}
.filter-panel-top .filter-group input[type="checkbox"] {
    vertical-align: middle;
    margin: 0; 
    transform: scale(0.9); 
}


.homebrew-assets-area {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start; 
}

.homebrew-asset-header {
    background-color: #D1C0A8; 
    padding: 10px 15px;
    border-bottom: 1px solid #b0a08c; 
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.homebrew-asset-header h3 {
    margin: 0;
    font-family: 'Merriweather', serif;
    color: #4a3b31; 
    font-size: 1.2em;
}

.homebrew-asset-header .asset-type-badge {
    width: fit-content;
    height: fit-content;
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #7a6252;
    color: #fdfaf3;
}

.homebrew-asset-content {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, 
                padding-top 0.35s ease-out, 
                padding-bottom 0.35s ease-out;
}

.homebrew-asset-card.expanded .homebrew-asset-content {
    max-height: 2000px; 
    padding-top: 10px;
    padding-bottom: 15px;
}

.creature-full-details p {
    margin: 6px 0; 
    line-height: 1.6;
}
.creature-full-details strong {
    color: #5c4033;
    display: inline-block;
    min-width: 130px; 
}

.asset-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
}


.homebrew-asset-card {
    background-color: #fdfaf3; 
    border: 1px solid #eDeCe6; 
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.homebrew-asset-subdiv {
    display: flex;
    flex-direction: row;
}

.homebrew-asset-subdiv div {
    margin: 0;
    text-align: center;
}

.homebrew-asset-header .expand-icon {
    font-weight: bold;
    font-size: 1.2em;
    transition: transform 0.35s ease;
    margin-left: 10px;
}

.homebrew-asset-card.expanded .expand-icon {
    transform: rotate(90deg);
}


.creature-full-details {
    font-size: 0.9em;
}
.creature-full-details .notes-section {
    margin-top: 10px;
    white-space: pre-wrap; 
    background-color: rgba(0,0,0,0.02);
    padding: 5px;
    border-radius: 3px;
}

.catalog-main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start; 
}

.homebrew-assets-columns { 
    flex: 3; 
    display: flex; 
    gap: 20px; 
}

.asset-column { 
    flex: 1; 
    display: flex;
    flex-direction: column; 
    gap: 20px; 
}


.filter-panel {
    flex: 1;
    background-color: rgba(239, 220, 187, 0.4);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #d2b48c;
    height: fit-content; 
    position: sticky; 
    top: 80px;      
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.filter-panel h2 {
    margin-top: 0;
    font-family: 'Merriweather', serif;
    color: #5c4033;
    font-size: 1.3em;
    border-bottom: 1px solid #8a5a2c;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.filter-group {
    margin-bottom: 8px;
}
.filter-group label {
    margin-left: 5px;
    color: #4a3b31;
}
.filter-group input[type="checkbox"] {
    vertical-align: middle;
}


/* Responsive adjustments for controls and layout */
@media (max-width: 900px) {
    .catalog-controls-bar {
        flex-direction: column;
        align-items: stretch; 
    }
    .filter-panel-top {
        margin-top: 10px; 
    }
    .filter-panel-top h2 {
        display: block; 
        margin-bottom: 8px;
    }
    .filter-panel-top .filter-options-container {
        flex-direction: row; 
        align-items: flex-start; 
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        padding: 1rem;
    }
    .top-bar nav ul {
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
    }
    .top-bar nav ul li {
        margin: 0.5rem 0;
    }
    .container {
        width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        margin-bottom: 10px;
    }

    /* Catalog specific adjustments for 768px */
    .catalog-controls-bar {
        flex-direction: column;
        align-items: flex-start; 
    }
    .catalog-main-layout {
        flex-direction: column;
    }
    .filter-panel {
        width: 100%;
        margin-top: 20px;
        position: static; 
        max-height: none;
    }
    .homebrew-assets-columns {
        flex-direction: column; 
    }
}


/* Session Notes Page Styles */
.sessions-area {
    margin-bottom: 20px;
}

.session-card {
    background-color: #fdfaf3; 
    border: 1px solid #eDeCe6; 
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.session-header {
    background-color: #D1C0A8; 
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #b0a08c;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.session-header h3 { 
    margin: 0;
    font-family: 'Merriweather', serif;
    color: #4a3b31;
    flex-grow: 1; 
}
.session-header input[type="text"] { 
    font-family: 'Merriweather', serif;
    color: #4a3b31;
    font-size: 1.2em; 
    font-weight: bold;
    border: none;
    background: transparent;
    padding: 0;
    flex-grow: 1;
    margin-right: 10px;
}
.session-header input[type="text"]:focus {
    box-shadow: none;
    border-bottom: 1px dashed #4a3b31; 
}

.lvlup-label {
    width: 6rem;
    text-align: right;
}
.session-header .level-up-group {
    display: flex;
    align-items: center;
    margin-left: 15px; 
}
.session-header .level-up-group label {
    font-size: 0.9em;
    color: #4a3b31;
    margin-right: 5px;
    margin-bottom: 0; 
    font-family: 'Lato', sans-serif;
}
.session-header .level-up-group input[type="number"] {
    width: 60px; 
    padding: 0.3rem 0.5rem;
    font-size: 0.9em;
    margin-right: 10px; 
}


.session-header .expand-icon {
    font-weight: bold;
    font-size: 1.2em;
    color: #4a3b31;
    transition: transform 0.35s ease;
}

.session-card.expanded .session-header .expand-icon {
    transform: rotate(90deg);
}

.session-details {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, 
                padding-top 0.35s ease-out, 
                padding-bottom 0.35s ease-out;
}

.session-card.expanded .session-details {
    max-height: 1500px; 
    padding-top: 15px;
    padding-bottom: 15px;
}

.session-details textarea { 
    width: 100%;
    min-height: 150px; 
    padding: 0.6rem 0.8rem;
    font-size: 0.95em;
}

.session-actions { 
    display: flex;
    justify-content: flex-end;
    padding-top: 10px; 
}
.session-actions .btn-delete-session {
    padding: 0.5rem 0.8rem;
    font-size: 0.9em;
}

.btn-add-new { 
    display: block;
    margin: 20px auto; 
}

.json-output-area {
    background-color: #f0f0f0; 
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 15px;
    max-height: 300px; 
    overflow-y: auto;
    white-space: pre-wrap; 
    word-break: break-all; 
    font-family: monospace; 
    font-size: 0.85em;
    text-align: left; 
}







#warningBox {
    background-color: #fff0f0; /* Light reddish background for warnings */
    border: 1px solid #dcc0c0;
    border-left: 5px solid #c0392b; /* Stronger left border for emphasis */
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px; /* Space between warning box and suggestions panel */
    position: sticky;
    bottom: 280px; /* Adjust based on top-bar height + desired gap, should be less than suggestionsPanel.top if suggestions is also sticky below it */
    z-index: 950; /* Ensure it's above form elements but potentially below modals */
}
#warningBox h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #a94442; /* Dark red for warning title */
    font-family: 'Merriweather', serif;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}
.warning-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}
#warningBox ul {
    list-style-type: disc; /* Or 'none' if prefixing with icons */
    padding-left: 20px;
    margin-bottom: 0;
    font-size: 0.9em;
    color: #5c4033;
}
#warningBox li {
    margin-bottom: 5px;
}



.table-contents-link {
    color: #3a8ec2; /* Light blue text for links */
    text-decoration: none;
    font-weight: bold;
}

code {
    background-color: rgba(167, 158, 135, 0.3); /* Light parchment background for code */
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace; /* Monospace font for code */
    font-size: 0.9em;
    color: #3a2410; /* Dark brown text for code */
}

.form-actions {
    display: flex;
    gap: 10px; /* Space between buttons */
    margin-top: 20px; /* Space above the buttons */
    align-items: center; /* Align items if they have different heights */
}

hr {
    border-color:rgba(92, 64, 51, 0.55);
    border-width: 1px;
}

h3 {
    margin-bottom: -1rem; /* Reduced margin for tighter spacing */
}

h4 {
    margin-bottom: -1rem; /* Reduced margin for tighter spacing */
}

#guide-container h2 {
    margin-top: 2rem !important;
    margin-bottom: 0;
}









body.darkmode {
    background-color: #0c1317;
    color: #f5e8c7;
}
body.darkmode::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    background-image:
        linear-gradient(to bottom right, rgba(2, 15, 31, 0.1) 25%, transparent 25%, transparent 75%, rgba(2, 15, 31, 0.1) 75%, rgba(2, 15, 31, 0.1)),
        linear-gradient(to bottom right, rgba(1, 8, 26, 0.05) 25%, transparent 25%, transparent 75%, rgba(1, 8, 26, 0.05) 75%, rgba(1, 8, 26, 0.05));
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #00060e;
}
body.darkmode .top-bar {
    background-color: #07141d;
    color: #f5e8c7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-bottom: 3px solid #083a5e;
}
body.darkmode #settings {
    background-color: rgba(12, 19, 23, 0.85);
}
body.darkmode .container {
    background-color: rgba(12, 19, 23, 0.85);
    color: #f5e8c7 !important;
}

body.darkmode .container h1 {
    color: #f5e8c7 !important;
}

body.darkmode #creatureForm fieldset {
    background-color: rgba(12, 19, 23, 0.85);
    border: 1px solid #2c4a6f;
    color: #f5e8c7 !important;
}

body.darkmode #creatureForm legend {
    color: #f5e8c7 !important;
}

body.darkmode .form-group label {
    color: #f5e8c7 !important;
}

body.darkmode .stat-value-display {
    color: #f5e8c7 !important;
}

body.darkmode #diagnosticsPanel {
    background-color: rgba(12, 19, 23, 0.85);
}

body.darkmode .diagnostics-info-area h4,
body.darkmode .diagnostics-info-area p,
body.darkmode .diagnostics-info-area span {
    color: #f5e8c7 !important;
}

body.darkmode .diagnostics-info-area h5 {
    color: #f5e8c77e !important;
}

body.darkmode .diagnostics-info-area a {
    color: #31e1d5 !important;
}

body.darkmode text.diag-label {
    fill: #f5e8c7 !important;
}

body.darkmode .hexagon-background {
    fill: rgba(142, 135, 119, 0.7) !important;
}

body.darkmode aside#suggestionsPanel {
    background-color: rgba(12, 19, 23, 0.85) !important;
}

body.darkmode aside#suggestionsPanel h1,
body.darkmode aside#suggestionsPanel h2,
body.darkmode aside#suggestionsPanel h3,
body.darkmode aside#suggestionsPanel h4,
body.darkmode aside#suggestionsPanel p,
body.darkmode aside#suggestionsPanel span,
body.darkmode aside#suggestionsPanel strong {
    color: #f5e8c7 !important;
}

body.darkmode .form-group input,
body.darkmode .form-group select,
body.darkmode .form-group textarea {
    background-color: rgba(12, 19, 23, 0.85) !important;
    color: #f5e8c7 !important;
}

body.darkmode .homebrew-asset-header {
    background-color: #2c4a6f; /* Darker blue for asset header */
}

body.darkmode .homebrew-asset-content {
    background-color: rgba(12, 19, 23, 0.85); /* Darker background for asset content */
    color: #f5e8c7 !important;
}

body.darkmode .party-member-header {
    background-color: #2c4a6f; /* Darker blue for asset header */
}

body.darkmode .party-member-details {
    background-color: rgba(12, 19, 23, 0.85); /* Darker background for asset content */
    color: #f5e8c7 !important;
}

body.darkmode .session-header {
    background-color: #2c4a6f; /* Darker blue for asset header */
}

body.darkmode .session-header label,
body.darkmode .session-header input,
body.darkmode .session-header span {
    color: #f5e8c7 !important;
}

body.darkmode .session-header input[type="number"] {
    background-color: rgba(12, 19, 23, 0.85) !important;
    color: #f5e8c7 !important;
}

body.darkmode .session-details {
    background-color: rgba(12, 19, 23, 0.85); /* Darker background for asset content */
    color: #f5e8c7 !important;
}

body.darkmode .sort-controls label {
    color: #f5e8c7 !important;
}

body.darkmode .filter-group label {
    color: #f5e8c7 !important;
}

body.darkmode .campaign-item {
    background-color: #0d1b28; /* Light parchment color */
    border: 1px solid #d2b48c; /* Tan border */
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-right: 2.5rem;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.darkmode .campaign-item:hover {
    background-color: #051729; /* Slightly darker on hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.monospace {
    font-family: monospace !important; /* Force monospace font for all text */
    font-size: large;
}

body.contrast {
    filter: contrast(1.5);
}

body.nomotion {
    animation: none !important;
    transition: none !important;
}

body.nomotion * {
    animation: none !important;
    transition: none !important;
}

body.nomotion *::before {
    animation: none !important;
    transition: none !important;
}

body.nomotion *::after {
    animation: none !important;
    transition: none !important;
}

