/* Accessibility improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 4px;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#room-header {
    width: fit-content;
    flex-shrink: 0;
}

.room-info {
    font-size: 18px;
    color: inherit;
    margin: 0 2px 0 0;
    padding-bottom: 3px;
    font-weight: bold;
    text-shadow: 2px 2px 0px rgba(70, 80, 90, 0.8), 3px 3px 6px rgba(70, 80, 90, 0.6);
}

/* Enhanced focus indicators */
*:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
a:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.room-tags {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Fix heading styles to be lighter and restore original hierarchy */
h1 {
    padding: 0;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(70, 80, 90, 0.8), 3px 3px 6px rgba(70, 80, 90, 0.6);
    font-weight: bold;
}

h2 {
    font-size: 16px;
    margin: 5px 0 5px 0;
    color: inherit;
}

h3 {
    padding: 0;
    margin: 0;
    color: inherit;
}

#nearby-rooms-heading {
    font-size: 16px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 25px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    color: inherit;
}

#nearby-rooms-heading + p {
    margin-bottom: 5px;
    margin-left: 25px;
    color: #555;
}

ul[role="list"] {
    list-style-type: disc;
    margin-left: 15px;
}

ul[role="list"] li {
    margin-bottom: 5px;
    line-height: 1.4;
}

ul[role="list"] a {
    font-weight: bold;
    text-decoration: none;
}

ul[role="list"] a:hover,
ul[role="list"] a:focus {
    text-decoration: underline;
}

/* Fix excessive margins on sections and content elements */
section {
    margin-top: 5px;
    margin-bottom: 5px;
}

main {
    margin-top: 5px;
    margin-bottom: 5px;
}

#main-content {
    padding-top: 5px !important;
    margin-top: 5px !important;
}

article {
    margin-top: 5px;
    margin-bottom: 5px;
}

header {
    margin-top: 0;
    margin-bottom: 0;
}

footer {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* High contrast and visual accessibility improvements */
@media (prefers-contrast: high) {
    *:focus {
        outline: 4px solid #000;
        outline-offset: 2px;
    }

    button:focus,
    input:focus,
    select:focus,
    a:focus {
        outline: 4px solid #000;
        outline-offset: 2px;
        background-color: #ffff00;
    }

    .highlight_box {
        border-width: 4px;
    }

    .tag_highlight_box,
    .location_highlight_box,
    .both_highlight_box {
        border-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .highlight_box,
    .highlight_box::before,
    .highlight_box::after {
        animation: none;
    }

    .highlight_box_example,
    .highlight_box_example::before,
    .highlight_box_example::after {
        animation: none;
    }

    .skip-link {
        transition: none;
    }
}

/* Better contrast for room information */
.room-location {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0 0;
    font-weight: bold;
}

th[scope="row"] {
    background-color: #f5f5f5;
    font-weight: bold;
    text-align: left;
    padding: 8px;
    width: 120px;
}

/* Enhanced table accessibility */
table caption {
    font-weight: bold;
    margin-bottom: 5px;
    text-align: left;
}

/* Better error and status styling */
[role="alert"],
[role="status"] {
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    border: 2px solid;
}

[role="alert"] {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

[role="status"] {
    background-color: #fffbeb;
    border-color: #d97706;
    color: #92400e;
}

/* Loading states */
select[disabled] {
    background-color: #f9f9f9;
    color: #666;
    cursor: not-allowed;
}

.highlight_box {
    padding: 0;
    position: absolute;
    border: 2px solid palevioletred;
    animation: animationFrames 5s infinite;
    z-index: 9;
}

.highlight_box::before,
.highlight_box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: animationFrames 5s infinite;
}

.highlight_box::before {
    background: linear-gradient(45deg, transparent 46%, palevioletred 46%, palevioletred 54%, transparent 54%);
}

.highlight_box::after {
    background: linear-gradient(-45deg, transparent 46%, palevioletred 46%, palevioletred 54%, transparent 54%);
}

#mapimage {
    max-width: 700px;
    z-index: 1;
    position: relative;
    cursor: pointer;
}
#mapimage:hover {
    -webkit-filter: opacity(20%);
    -moz-filter: opacity(20%);
    -o-filter: opacity(20%);
    -ms-filter: opacity(20%);
    filter: opacity(20%);
}
@keyframes animationFrames {
    0% {
        border-color: palevioletred;
    }
    50% {
        border-color: green;
    }
    100% {
        border-color: palevioletred;
    }
}

#image_wrapper {
    padding: 1px 25px 5px 25px;
    position: relative;
}

#image_div { 
    padding: 0;
}

#after_image {
    padding: 0;
    margin-top: 5px;
}

.after_table_divs {
    padding-bottom: 0;
    padding-top: 0;
    padding-left: 25px;
    padding-right: 25px;
}

.after_tables {
    width: 50%;
    border: 2px solid;
}

#exit_table {
    width: 20%;
}

table tr th {
    text-align: left;
    border: 1px solid;
    border-top: 5px solid;
}

table tr td {
    text-align: left;
    border: 1px solid;
}

article#full_info_article {
    padding: 5px;
}

#full_info_div,
#nearby_rooms_div {
    padding-left: 25px;
    margin-top: 5px;
}

#full_info_details,
#nearby_rooms_details {
}

#full_info_code {
    white-space: pre-wrap;
    font-size: 10px;
}

#updated_at {
    padding: 0;
    margin: 5px 25px;
}

#sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--background-color, #11191f);
}

/* Fix navigation header padding */
#navigation_header {
    padding: 2px 25px;
    background-color: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#header {
	padding: 0 25px 0 25px;
}

#title_row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 0;
    gap: 15px;
}

#title_row h1 {
    margin: 0;
    text-shadow: 2px 2px 0px rgba(70, 80, 90, 0.8), 3px 3px 6px rgba(70, 80, 90, 0.6);
    font-weight: bold;
}

#tag_selector {
    padding-top: 0;
    padding-bottom: 2px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#tag_selector label {
    margin-right: 5px;
    font-weight: bold;
    font-size: 13px;
    line-height: 1;
}

#tag_dropdown,
#location_dropdown {
    padding: 3px;
    margin-bottom: 0px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    min-width: 120px;
    max-width: 200px;
    line-height: 1;
    vertical-align: baseline;
}

#opacity_toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 20px;
    flex-shrink: 0;
    margin-left: 0;
}

#opacity_toggle input {
    margin: 0;
    transform: scale(0.7);
}

#opacity_toggle label {
    font-size: 11px;
    font-weight: normal;
    line-height: 1;
}

#map_navigation {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 5px;
    padding-bottom: 0px;
    flex-wrap: nowrap;
}

#map_dropdown,
#adjacent_map_dropdown {
    padding: 2px 4px;
    font-size: 11px !important;
    border: 1px solid #ccc;
    border-radius: 3px;
    max-width: 200px;
    line-height: 1.2;
    margin-top: auto;
    margin-bottom: 0;
}

#search_link,
#scroll_top_btn,
#copy_link_btn {
    font-size: 14px;
    color: inherit;
    padding: 2px 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
    background: transparent;
    border: none;
    outline: none;
}

#search_link:hover,
#scroll_top_btn:hover,
#copy_link_btn:hover {
    opacity: 0.7;
    background: transparent;
}

#map_dropdown optgroup,
#adjacent_map_dropdown optgroup {
    font-weight: bold;
    font-size: 12px !important;
    background-color: #e6f3ff;
    color: #0066cc;
    padding: 2px 4px;
}

#map_dropdown option,
#adjacent_map_dropdown option {
    font-weight: normal;
    font-size: 11px !important;
    color: hsl(205deg, 16%, 77%) !important;
}

#mapimage.opacity_active {
    -webkit-filter: opacity(20%);
    -moz-filter: opacity(20%);
    -o-filter: opacity(20%);
    -ms-filter: opacity(20%);
    filter: opacity(20%);
}

.highlight_box,
.tag_highlight_box,
.location_highlight_box,
.both_highlight_box {
    opacity: 1 !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -o-filter: none !important;
    -ms-filter: none !important;
    filter: none !important;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tag_highlight_box {
    pointer-events: none;
    box-sizing: border-box;
    border: 2px solid blue;
}

.tag_highlight_box::before,
.tag_highlight_box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tag_highlight_box::before {
    background: linear-gradient(45deg, transparent 46%, blue 46%, blue 54%, transparent 54%);
}

.tag_highlight_box::after {
    background: linear-gradient(-45deg, transparent 46%, blue 46%, blue 54%, transparent 54%);
}

.location_highlight_box {
    pointer-events: none;
    box-sizing: border-box;
    border: 2px solid lightgreen;
}

.location_highlight_box::before,
.location_highlight_box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.location_highlight_box::before {
    background: linear-gradient(45deg, transparent 46%, lightgreen 46%, lightgreen 54%, transparent 54%);
}

.location_highlight_box::after {
    background: linear-gradient(-45deg, transparent 46%, lightgreen 46%, lightgreen 54%, transparent 54%);
}

.both_highlight_box {
    pointer-events: none;
    box-sizing: border-box;
    border: 2px solid darkviolet;
}

.both_highlight_box::before,
.both_highlight_box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.both_highlight_box::before {
    background: linear-gradient(45deg, transparent 46%, darkviolet 46%, darkviolet 54%, transparent 54%);
}

.both_highlight_box::after {
    background: linear-gradient(-45deg, transparent 46%, darkviolet 46%, darkviolet 54%, transparent 54%);
}

#help_icon {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
    margin-bottom: 0px;
    user-select: none;
    padding: 0;
    min-width: 16px;
    min-height: 16px;
}

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

#help_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Restore smaller help popup */
#help_popup_content {
    background-color: #11191f;
    color: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 280px;
    white-space: nowrap;
}

#help_close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 16px;
    cursor: pointer;
    color: #ccc;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
}

#help_close:hover,
#help_close:focus {
    color: white;
    outline: 2px solid #fff;
}

#help_popup h2 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.help_example {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.help_highlight {
    width: 30px;
    height: 20px;
    position: relative;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.highlight_box_example {
    border: 2px solid palevioletred;
    animation: help_animationFrames 2s infinite;
}

.highlight_box_example::before,
.highlight_box_example::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: help_animationFrames 2s infinite;
}

.highlight_box_example::before {
    background: linear-gradient(45deg, transparent 46%, palevioletred 46%, palevioletred 54%, transparent 54%);
}

.highlight_box_example::after {
    background: linear-gradient(-45deg, transparent 46%, palevioletred 46%, palevioletred 54%, transparent 54%);
}

.tag_highlight_box_example {
    border: 2px solid blue;
}

.tag_highlight_box_example::before,
.tag_highlight_box_example::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tag_highlight_box_example::before {
    background: linear-gradient(45deg, transparent 46%, blue 46%, blue 54%, transparent 54%);
}

.tag_highlight_box_example::after {
    background: linear-gradient(-45deg, transparent 46%, blue 46%, blue 54%, transparent 54%);
}

.location_highlight_box_example {
    border: 2px solid lightgreen;
}

.location_highlight_box_example::before,
.location_highlight_box_example::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.location_highlight_box_example::before {
    background: linear-gradient(45deg, transparent 46%, lightgreen 46%, lightgreen 54%, transparent 54%);
}

.location_highlight_box_example::after {
    background: linear-gradient(-45deg, transparent 46%, lightgreen 46%, lightgreen 54%, transparent 54%);
}

.both_highlight_box_example {
    border: 2px solid darkviolet;
}

.both_highlight_box_example::before,
.both_highlight_box_example::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.both_highlight_box_example::before {
    background: linear-gradient(45deg, transparent 46%, darkviolet 46%, darkviolet 54%, transparent 54%);
}

.both_highlight_box_example::after {
    background: linear-gradient(-45deg, transparent 46%, darkviolet 46%, darkviolet 54%, transparent 54%);
}

@keyframes help_animationFrames {
    0% {
        border-color: palevioletred;
    }
    50% {
        border-color: green;
    }
    100% {
        border-color: palevioletred;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .room-ids,
    .room-location {
        color: #ccc;
    }

    .room-tags {
        color: #aaa;
    }

    th[scope="row"] {
        background-color: #2a2a2a;
        color: #fff;
    }

    [role="alert"] {
        background-color: #2d1b1b;
        border-color: #ef4444;
        color: #fecaca;
    }

    [role="status"] {
        background-color: #2d2416;
        border-color: #f59e0b;
        color: #fcd34d;
    }
}

/* Compact and accessible search results styling */
.search-results-list {
    margin-top: 8px;
    list-style: none;
    padding: 0;
}

.search-result-item {
    margin-bottom: 2px;
    border-bottom: 1px solid #eee;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-link {
    display: block;
    padding: 6px 8px;
    text-decoration: none;
    color: inherit;
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.result-link:hover,
.result-link:focus {
    background-color: #f0f8ff;
    text-decoration: none;
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

.result-title {
    display: block;
    font-weight: bold;
    color: #0066cc;
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.result-meta {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.1;
}

/* Dark mode support for search results */
@media (prefers-color-scheme: dark) {
    .search-result-item {
        border-bottom-color: #444;
    }

    .result-link:hover,
    .result-link:focus {
        background-color: #2a2a2a;
        outline-color: #66b3ff;
    }

    .result-title {
        color: #66b3ff;
    }

    .result-meta {
        color: #bbb;
    }
}

/* Map groups styling for large result sets - zero spacing */
.map-groups-container {
    margin: 5px 0 0 0;
    padding: 0;
}

.map-group-form {
    margin: 0;
    padding: 0;
    display: block;
}

.map-group-button {
    display: block;
    width: 100%;
    padding: 4px 6px;
    margin: 0;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0;
    background-color: #f9f9f9;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
}

.map-group-form:first-child .map-group-button {
    border-top: 1px solid #ddd;
    border-radius: 2px 2px 0 0;
}

.map-group-form:last-child .map-group-button {
    border-radius: 0 0 2px 2px;
}

.map-group-button:hover,
.map-group-button:focus {
    background-color: #e6f3ff;
    border-color: #0066cc;
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

.map-name {
    font-weight: bold;
    color: #0066cc;
}

.map-count {
    font-size: 11px;
    color: #666;
    margin-left: 2px;
}

.unmapped-button .map-name {
    color: #d97706;
}

/* Dark mode support for map groups */
@media (prefers-color-scheme: dark) {
    .map-groups-list {
        border-color: #444;
    }

    .map-group-button {
        background-color: #2a2a2a;
        border-color: #555;
    }

    .map-group-button:hover,
    .map-group-button:focus {
        background-color: #333;
        border-color: #66b3ff;
        outline-color: #66b3ff;
    }

    .map-name {
        color: #66b3ff;
    }

    .map-count {
        color: #bbb;
    }

    .unmapped-button .map-name {
        color: #fbbf24;
    }
}

.room-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-left: 25px;
    margin-right: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.room-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.room-description {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
    color: #334155;
}

.room-paths {
    margin-bottom: 20px;
    color: #475569;
    font-size: 15px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.path-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.path-link:hover {
    color: #0055aa;
    text-decoration: underline;
}

.room-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.2s;
}

.tag-badge:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.exits-section {
    margin-top: 30px;
    margin-left: 25px;
    margin-right: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
}

.exits-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.exits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.exit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.exit-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background-color: #0066cc;
    transition: width 0.2s ease;
}

.exit-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.exit-item:hover::after {
    width: 100%;
}

.exit-item:focus {
    border-color: #0066cc;
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.exit-command {
    font-weight: 600;
    color: #0066cc;
    font-family: monospace;
    font-size: 11px;
}

.exit-item-compact {
    padding: 5px 8px;
}

.exit-item-compact .exit-command {
    font-size: 11px;
}

.exit-item-compact .exit-id {
    font-size: 10px;
}

.exit-arrow {
    margin: 0 4px;
    color: #94a3b8;
    font-weight: 300;
    font-size: 10px;
}

.exit-id {
    color: #64748b;
    font-family: monospace;
    font-size: 10px;
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 3px;
}

.exits-tabs {
    display: inline-flex;
    gap: 0;
    margin-bottom: 10px;
}

.exits-tab {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-right: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.exits-tab:first-child {
    border-radius: 3px 0 0 3px;
}

.exits-tab:last-child {
    border-right: 1px solid #cbd5e1;
    border-radius: 0 3px 3px 0;
}

.exits-tab:hover {
    background: #e2e8f0;
    color: #334155;
}

.exits-tab[aria-selected="true"] {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.exits-tab:last-child[aria-selected="true"] {
    border-right-color: #0066cc;
}

.exits-tab:focus {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
    z-index: 1;
    position: relative;
}

.stringproc-panel {
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.stringproc-subtabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}

.stringproc-subtab {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #f1f5f9;
    font-family: monospace;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
}

.stringproc-subtab:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.stringproc-subtab[aria-selected="true"] {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.stringproc-subtab:focus {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

.stringproc-code-container {
    overflow-y: auto;
    border-radius: 3px;
    background: #1e1e1e;
}

.stringproc-code-container pre,
.stringproc-code-container pre[class*="language-"] {
    margin: 0 !important;
    padding: 6px !important;
    border-radius: 3px !important;
    background: #1e1e1e !important;
}

.stringproc-code-container code,
.stringproc-code-container code[class*="language-"],
.stringproc-code-container pre[class*="language-"] code {
    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    background: transparent !important;
}

.stringproc-code-container .token,
.stringproc-code-container .token.keyword,
.stringproc-code-container .token.function,
.stringproc-code-container .token.class-name,
.stringproc-code-container .token.bold {
    font-weight: 400 !important;
}

.collapsibles-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.collapsibles-row > section {
    flex: 1;
    min-width: 0;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    padding: 8px 0;
    user-select: none;
    transition: color 0.2s;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    font-size: 0.8em;
    transition: transform 0.2s;
    color: #94a3b8;
}

details[open] summary::before {
    transform: rotate(90deg);
}

details summary:hover {
    color: #0066cc;
}

details summary:hover::before {
    color: #0066cc;
}

.inline-search-section {
    margin-top: 40px;
    margin-left: 25px;
    margin-right: 25px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

.inline-search {
    display: flex;
    max-width: 600px;
    gap: 12px;
    margin-bottom: 5px;
}

.inline-search input {
    flex-grow: 1;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-search input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.inline-search button {
    padding: 10px 24px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.inline-search button:hover {
    background-color: #0055aa;
    transform: translateY(-1px);
}

.inline-search button:active {
    transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
    .room-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .room-description {
        color: #e2e8f0;
    }
    
    .room-paths {
        color: #94a3b8;
        background-color: #0f172a;
        border-color: #1e293b;
    }
    
    .path-link {
        color: #66b3ff;
    }
    
    .path-link:hover {
        color: #99ccff;
    }
    
    .tag-badge {
        background-color: #334155;
        color: #e2e8f0;
        border-color: #475569;
    }
    
    .tag-badge:hover {
        background-color: #475569;
        color: #fff;
        border-color: #64748b;
    }

    .exits-heading {
        color: #94a3b8;
        border-bottom-color: #334155;
    }
    
    .exit-item {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }
    
    .exit-item:hover, .exit-item:focus {
        background-color: #334155;
        border-color: #66b3ff;
    }
    
    .exit-command {
        color: #66b3ff;
    }
    
    .exit-id {
        background: #0f172a;
        color: #94a3b8;
    }
    
    .exits-section {
        border-bottom-color: #334155;
    }
    
    .exits-tab {
        background: #1e293b;
        border-color: #475569;
        color: #94a3b8;
    }
    
    .exits-tab:last-child {
        border-right-color: #475569;
    }
    
    .exits-tab:hover {
        color: #e2e8f0;
        background: #334155;
    }
    
    .exits-tab[aria-selected="true"] {
        background: #3399ff;
        border-color: #3399ff;
        color: white;
    }
    
    .exits-tab:last-child[aria-selected="true"] {
        border-right-color: #3399ff;
    }
    
    .exits-tab:focus {
        outline-color: #66b3ff;
    }
    
    .stringproc-panel {
        background: #1e293b;
        border-color: #334155;
    }
    
    .stringproc-subtab {
        background: #1e293b;
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .stringproc-subtab:hover {
        background: #334155;
        border-color: #64748b;
    }
    
    .stringproc-subtab[aria-selected="true"] {
        background: #3399ff;
        border-color: #3399ff;
        color: white;
    }
    
    .stringproc-subtab:focus {
        outline-color: #66b3ff;
    }

    .inline-search-section {
        border-top-color: #334155;
    }
    
    .inline-search input {
        background-color: #1e293b;
        border-color: #475569;
        color: #fff;
    }

    .inline-search input:focus {
        border-color: #66b3ff;
        box-shadow: 0 0 0 3px rgba(102, 179, 255, 0.1);
    }
    
    .inline-search button {
        background-color: #0066cc;
    }
    
    .inline-search button:hover {
        background-color: #3399ff;
    }

    details summary {
        color: #94a3b8;
    }

    details summary:hover {
        color: #66b3ff;
    }

    details summary:hover::before {
        color: #66b3ff;
    }
}

@media (max-width: 768px) {
    .collapsibles-row {
        flex-direction: column;
    }
    
    .exits-grid {
        grid-template-columns: 1fr;
    }
    
    .room-card, .exits-section, .inline-search-section {
        margin-left: 10px;
        margin-right: 10px;
    }

    #nearby_rooms_div, #full_info_div {
        padding-left: 10px;
    }
}

.nearby-rooms-content {
    font-size: 10px;
    padding: 5px;
}

.nearby-rooms-list {
    margin: 0;
    padding-left: 16px;
    line-height: 1.3;
}

.nearby-rooms-list li {
    margin-bottom: 2px;
}

.nearby-rooms-list a {
    font-size: 10px;
}

.nearby-location {
    font-size: 10px;
}

#copy_link_popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #166534;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

#copy_link_popup.visible {
    opacity: 1;
    visibility: visible;
}

.inline-search-container {
    max-width: 800px;
}

.inline-search-divider {
    margin: 5px 0;
    font-size: 13px;
    color: #64748b;
    font-weight: bold;
}

.inline-tag-search {
    margin-top: 8px;
}

.inline-tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.inline-tag-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.inline-tag-input-wrapper input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

#inlineTagSuggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 180px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.inline-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.inline-suggestion-item:hover,
.inline-suggestion-item.selected {
    background-color: #0066cc;
    color: white;
}

.inline-tag-row select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    min-width: 140px;
    background: white;
}

.inline-tag-row select:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

.inline-tag-row button {
    padding: 8px 16px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.inline-tag-row button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.inline-tag-row button:not(:disabled):hover {
    background-color: #0055aa;
}

@media (prefers-color-scheme: dark) {
    .inline-search-divider {
        color: #94a3b8;
    }
    
    .inline-tag-input-wrapper input {
        background-color: #1e293b;
        border-color: #475569;
        color: #e2e8f0;
    }
    
    #inlineTagSuggestions {
        background: #1e293b;
        border-color: #475569;
    }
    
    .inline-suggestion-item {
        color: #e2e8f0;
        border-bottom-color: #334155;
    }
    
    .inline-suggestion-item:hover,
    .inline-suggestion-item.selected {
        background-color: #3399ff;
    }
    
    .inline-tag-row select {
        background-color: #1e293b;
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .inline-tag-row select:disabled {
        background: #0f172a;
        color: #64748b;
    }
}

@media (max-width: 768px) {
    .inline-tag-row {
        flex-direction: column;
    }
    
    .inline-tag-input-wrapper,
    .inline-tag-row select {
        width: 100%;
        min-width: unset;
    }
    
    .inline-tag-row button {
        width: 100%;
    }
}
