@font-face {
    font-family: 'SUIT-Regular';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Prevent FOUT layout shift */
}

body {
    font-family: "Noto Sans KR", serif;
    padding: 0px;
    margin: auto;
    max-width: 600px;
}

/* Shimmer Loading Animation - GPU composited using transform */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes rank-badge-shimmer {
    0% { background-position: -250px 0; }
    100% { background-position: 250px 0; }
}

.shimmer-placeholder {
    position: relative;
    overflow: hidden;
    background: #f2f4f6;
    border-radius: 4px;
    color: transparent !important;
    vertical-align: middle;
}

.shimmer-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent 0%, #e9ecef 50%, transparent 100%);
    animation: shimmer 1.5s infinite linear;
    will-change: transform;
}

.shimmer-text-sm {
    display: inline-block;
    height: 14px;
    min-width: 80px;
}

.shimmer-text-md {
    display: inline-block;
    height: 16px;
    min-width: 120px;
}

.shimmer-block {
    display: block;
    height: 24px; /* Reduced to match typical text line height */
    width: 100%;
    margin-bottom: 8px;
}

/* =========================================
   Sticky Navigation Menu
   ========================================= */

.sticky-nav {
    position: fixed;
    top: 10px;
    left: 15px;
    right: 15px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out, visibility 0.25s;
}

.sticky-nav.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sticky-nav-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    padding: 8px 12px 6px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-nav-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px 8px 8px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
}

.sticky-nav-inner::-webkit-scrollbar {
    display: none;
}

.sticky-nav-indicator {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.05); /* Slightly softer, natural gray */
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 0;
}

.sticky-nav-indicator.visible {
    opacity: 1;
}

.sticky-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    padding: 4px 8px;
    min-height: 36px;
    min-width: 36px;
    border-radius: 6px;
    transition: all 0.15s ease-out;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Remove native highlight color */
    user-select: none;
}

.sticky-nav-item:hover,
.sticky-nav-item:focus {
    color: #333;
    /* Removed background-color */
}

.sticky-nav-item:active {
    transform: scale(0.96);
    /* Removed background-color */
}

.sticky-nav-icon {
    width: 18px;
    height: 18px;
    stroke: #888;
    stroke-width: 2;
    margin-bottom: 2px;
    transition: all 0.15s ease-out;
    pointer-events: none;
}

.sticky-nav-item:hover .sticky-nav-icon,
.sticky-nav-item:focus .sticky-nav-icon {
    stroke: #333;
}

.sticky-nav-label {
    font-size: 10px;
    font-weight: 600;
    pointer-events: none; /* Ensure clicks pass through to parent */
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
    .sticky-nav-inner {
        padding: 4px 4px;
    }
    
    .sticky-nav-item {
        padding: 6px 6px;
        min-width: 40px;
    }
    
    .sticky-nav-label {
        font-size: 9px;
    }
    
    .sticky-nav-icon {
        width: 18px;
        height: 18px;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    /* Pushes menu to the right */
    align-items: center;
    /* Vertically centers the items */
}

.subheading {
    padding: 0px 30px 0px 15px;
    font-weight: 600;
    font-size: 16px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    padding: 15px 15px 15px 15px;
    margin: 0px;
}

.menu {
    display: flex;
    gap: 15px;
    padding: 15px 30px 15px 15px;
}

.menu a {
    display: flex;
    align-items: center;
}

.menu svg {
    width: 20px;
    height: 20px;
    stroke: rgb(78, 89, 104);
    stroke: rgb(130, 130, 130);
    stroke-width: 3;
    position: relative;
    bottom: 2px;
}

h1,
h2,
h3 {
    margin: 0px;
    padding: 0px;
    font-weight: inherit;
    font-size: inherit;
}

.header-container>h1,
.header-container>h2,
.header-container>h3 {
    font-size: 18px;
    font-weight: 700;
    padding: 30px 15px 15px 15px;
    margin: 0px;
}

.menu-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 0px 15px 15px 15px;
    margin: auto;
}

.menu-section {
    width: 100%;
}

ul {
    list-style-type: none;
    margin: 0px;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0px;
    /* Optional: Adds spacing between items */
}

li {
    margin: 3px;
    /* Remove if you don't need extra space below items */
}

button {
    padding: 20px 3px;
    background-color: rgb(242, 244, 246);
    border-radius: 10px;
    color: rgb(78, 89, 104);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    /* width: 100%; Removed from general button style */
}

/* Apply width: 100% specifically to buttons that are direct children of li elements */
li>button {
    width: 100%;
}

/* Modified to exclude .toggle-btn and .area-toggle-btn from this generic hover/active/focus style */
button:not(.toggle-btn):not(.area-toggle-btn):active,
button:not(.toggle-btn):not(.area-toggle-btn):focus,
button:not(.toggle-btn):not(.area-toggle-btn):hover {
    background-color: #fff !important;
    /* Keeps the background white when clicked */
    box-shadow: none;
    /* Removes any shadow effect */
}

#subarea-list,
#subsubarea-list {
    padding-left: 0px;
}

#status-line {
    padding: 10px 15px 18px 21px;
    margin-bottom: 0px;
    font-size: 28px;
    font-weight: 500;
    height: 35px;
    color: rgb(130, 130, 130);
}

/* Styling the links */
.status-link {
    color: #007BFF;
    /* Link color: a nice blue shade */
    text-decoration: underline;
    text-decoration-color: #007BFF;
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
    cursor: pointer;
    /* Show a pointer cursor on hover */
    margin-right: 0px;
    /* Space between links */
}

.status-link:hover {
    text-decoration: underline;
    /* Add underline on hover for better UX */
    color: #0056b3;
    /* Darker blue on hover */
}

.area-list-container {
    list-style-type: none;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0px;
    /* Optional: Adds spacing between items */
}

.area-list-item {
    display: block;
    /* Each <li> will take up the full width of its container */
    padding: 10px 0;
    /* Add some spacing between list items */
    border-bottom: 0px solid #ddd;
    /* Optional: Add a border to separate items */
}

.cdeal {
    opacity: 0.5;
    text-decoration-line: line-through;
    text-decoration-color: rgb(107, 118, 132);
}

.max-dot {
    fill: rgb(245, 130, 141);
    /* Darker red for maximum */
}

.min-dot {
    fill: rgb(245, 130, 141);
    /* Darker blue for minimum */
}

/* Styles for Deal Type Toggle Buttons (from deallist1.html) */
.deal-type-toggles {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    margin-bottom: 8px;
}

.toggle-btn {
    /* For 매매, 전세, 월세 buttons */
    flex: 1;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #555;
    /* Removed transition to avoid non-composited animation warnings */
    text-align: center;
    cursor: pointer;
    /* Added cursor */
}

.toggle-btn:hover {
    background-color: #e9ecef;
    border-color: #d0d0d0;
    color: #333;
}

.toggle-btn.active {
    color: white;
    font-weight: 600;
}

.toggle-btn.active[data-type="매매"] {
    background-color: rgb(240, 68, 82);
    border-color: rgb(240, 68, 82);
}

.toggle-btn.active[data-type="전세"] {
    background-color: rgb(2, 147, 89);
    border-color: rgb(2, 147, 89);
}

.toggle-btn.active[data-type="월세"] {
    background-color: rgb(27, 100, 218);
    border-color: rgb(27, 100, 218);
}

.toggle-btn.active[data-type="매매"]:hover {
    background-color: rgb(220, 53, 69);
    border-color: rgb(220, 53, 69);
}

.toggle-btn.active[data-type="전세"]:hover {
    background-color: rgb(1, 127, 77);
    border-color: rgb(1, 127, 77);
}

.toggle-btn.active[data-type="월세"]:hover {
    background-color: rgb(23, 88, 190);
    border-color: rgb(23, 88, 190);
}

/* Styles for Area Filter Toggle Buttons - MATCH deallist/officetellist */
.area-filter-toggles-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 5px 0px 8px 0px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    position: relative;
    cursor: grab;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.area-filter-toggles-container::-webkit-scrollbar {
    display: none;
}

.area-filter-toggles-container::before,
.area-filter-toggles-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

.area-filter-toggles-container::before {
    left: 0;
}

.area-filter-toggles-container::after {
    right: 0;
}

.area-filter-toggles-container.show-left-fade::before {
    opacity: 1;
}

.area-filter-toggles-container.show-right-fade::after {
    opacity: 1;
}

.area-toggle-btn {
    width: 120px;
    height: 50px;
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #555;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    cursor: pointer;
}

.area-toggle-btn .area-size {
    /* Main area text, e.g., '84m²' */
    font-weight: inherit;
}

.area-toggle-btn .area-avg-price {
    font-size: 11px;
    color: #555;
    font-weight: 400;
    margin-top: 2px;
    white-space: nowrap;
}

.area-toggle-btn .area-avg-price-explanation {
    font-size: 10px;
    color: #777;
    font-weight: 400;
    margin-top: 1px;
    white-space: nowrap;
    line-height: 1.2;
}

.area-toggle-btn:hover {
    background-color: #e9ecef;
    border-color: #d0d0d0;
    color: #333;
}

.area-toggle-btn.active {
    background-color: #343a40;
    color: white;
    border-color: #343a40;
    font-weight: 600;
}

.area-toggle-btn.active .area-avg-price {
    color: #ccc;
}

.area-toggle-btn.active .area-avg-price-explanation {
    color: #bbb;
}

.area-toggle-btn.active:hover {
    background-color: #23272b;
    border-color: #1d2124;
}

.area-toggle-explanation {
    /* For the separate text element below button row */
    font-family: 'SUIT-Regular', "Noto Sans KR", serif;
    font-size: 10.5px;
    color: rgb(110, 110, 110);
    text-align: right;
    padding-right: 5px;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 400;
    line-height: 1.4;
}

/* Styles for Trend Analysis Section */
.trend-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 18px;
    font-size: 13px;
}

.trend-label {
    flex-shrink: 0;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 12px;
    width: 35px;
    text-align: center;
    position: relative;
    top: 1px;
}

.trend-details {
    line-height: 1.6;
    color: #343a40;
    margin: 2px 0;
}

.trend-details>p {
    margin: 0 0 6px 0;
}

.trend-comparison {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.trend-comparison svg {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    position: relative;
    bottom: 1px;
    margin-right: 2px;
}

.trend-up {
    color: rgb(240, 68, 82);
}

.trend-down {
    color: rgb(49, 130, 246);
}

.trend-neutral {
    color: rgb(107, 118, 132);
}

.trend-up svg {
    fill: rgb(240, 68, 82);
}

.trend-down svg {
    fill: rgb(49, 130, 246);
}

.trend-neutral svg {
    fill: rgb(107, 118, 132);
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tooltip-icon {
    color: #adb5bd;
}

.tooltip-container .tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 10;
    bottom: 140%;
    left: 50%;
    margin-left: -120px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.tooltip-container .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Survey Styles */
.survey-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background-color: #fff;
    color: #495057;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.survey-btn:hover {
    background-color: #f1f3f5;
    border-color: #ced4da;
}

.survey-btn.selected {
    background-color: #343a40;
    color: white;
    border-color: #343a40;
    font-weight: 600;
}

.area-toggle-btn,
.area-toggle-btn * {
    font-family: "Noto Sans KR", serif !important;
}

/* Trend Interval Toggles */
.trend-interval-btn {
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    background-color: transparent;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.trend-interval-btn:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.trend-interval-btn.active {
    background-color: white;
    color: #212529;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Rank Interval Toggles */
.rank-interval-btn {
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    background-color: transparent;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.rank-interval-btn:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.rank-interval-btn.active {
    background-color: white;
    color: #212529;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.trend-interval-btn,
#trend-area-select,
#chart-area-select,
.rank-interval-btn {
    touch-action: manipulation;
}

#trend-area-select,
#chart-area-select {
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    background-color: white;
    color: #212529;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    height: 28px;
    min-width: 85px; /* Prevent CLS when options are dynamically populated */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23495057%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-6.5%200-12.1%203.2-15.9%208.1-3.8%204.9-4.9%2011-3.4%2017.4l130.6%20130.6c2.8%202.8%206.7%204.3%2010.6%204.3s7.8-1.5%2010.6-4.3l130.6-130.6c3.8-3.8%205-9.9%203.4-17.4z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 25px;
}

/* Responsive adjustments for trend controls */
@media (max-width: 480px) {
    .trend-controls-header {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px;
    }

    .trend-controls-header>h3 {
        width: 100%;
        margin: 0;
    }

    .trend-controls-options {
        flex-grow: 1;
        justify-content: flex-end;
        width: 100%;
    }
}

/* =========================================
   Refactored Inline Styles
   ========================================= */

.header-link {
    text-decoration: none;
    color: #000;
    font-size: 18px;
    font-weight: 700;
    padding: 15px;
    margin: 0px;
}

.header-logo-img {
    height: 22px;
    padding: 0px 6px 4px 6px;
    vertical-align: middle;
}

.main-title {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin: 0px;
}

.sub-info {
    display: block;
    font-size: 14px;
    color: rgb(107, 118, 132);
    margin: 5px 0px;
    height: 20px;
}

.rank-badge-link {
    text-decoration: none;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    min-height: 28px; /* Standardize height to match deallist */
}

.rank-badge-placeholder {
    display: inline-block;
    padding: 4px 8px 4px 6px;
    font-size: 12px;
    border-radius: 5px;
    color: transparent !important;
    background: linear-gradient(to right, #f2f4f6 8%, #e9ecef 18%, #f2f4f6 33%);
    background-size: 500px 100%;
    animation: rank-badge-shimmer 1.5s infinite linear;
    width: 250px;
    line-height: normal;
}

.rank-badge-content {
    display: none;
    padding: 4px 8px 4px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    border-radius: 5px;
    background-color: rgb(242, 244, 246);
    line-height: normal;
}

.otherdanji-toggle {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    border-radius: 5px;
    background-color: rgb(242, 244, 246);
    cursor: pointer;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
}

.analysis-container {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
    margin: 0;
    display: flex;
    align-items: center;
}

.section-title-large {
    font-weight: 700;
    font-size: 18px;
    margin: 0px 0 15px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 0px 0 0 0;
}

.th-base {
    text-align: left;
    padding: 10px 5px 10px 10px;
    font-size: 12px;
    font-weight: 600;
}

.th-date {
    width: 50px;
}

.th-amount {
    width: 155px;
}

.th-center {
    text-align: center;
    padding: 10px 5px;
    font-size: 12px;
    font-weight: 600;
}

.th-area {
    width: 70px;
}

.th-rate {
    width: 70px;
}

.td-date {
    text-align: left;
    padding: 10px 5px 10px 10px;
    font-size: 12px;
    color: rgb(107, 118, 132);
    font-weight: 400;
}

.td-amount {
    text-align: left;
    padding: 10px 5px 10px 10px;
    font-size: 14px;
    color: rgb(40, 44, 48);
    font-weight: 600;
}

.td-area {
    text-align: center;
    padding: 10px 5px;
    font-size: 12px;
    color: rgb(107, 118, 132);
    font-weight: 400;
    line-height: 1.4;
}

.td-rate {
    text-align: center;
    padding: 10px 5px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.badge-base {
    position: relative;
    bottom: 1px;
    margin: 2px;
    padding: 0px 4px 1px 4px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 10px;
}

.badge-sale {
    color: #000;
    background-color: rgb(242, 244, 246);
}

.badge-jeonse {
    color: rgb(2, 147, 89);
    background-color: rgba(3, 178, 108, 0.13);
}

.badge-monthly {
    color: rgb(27, 100, 218);
    background-color: rgba(49, 130, 246, 0.16);
}

.btn-show-more {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    background-color: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.btn-map-control {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    background-color: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

.map-view-container {
    display: none;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    margin-top: 10px;
}

.otherdanji-link {
    text-decoration: none;
    display: block;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.otherdanji-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.otherdanji-price {
    font-size: 12px;
    color: #666;
}

.comparison-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.comparison-link-card:hover {
    background-color: #fff;
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.comparison-link-card svg {
    flex-shrink: 0;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.comparison-link-card:hover svg {
    stroke: #495057;
    transform: translateX(3px);
}

/* nearby-carousel Styles for villalist.html */
.nearby-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 5px 4px 20px 4px; /* Extra bottom padding for shadow visibility + side padding */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nearby-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nearby-card {
    flex: 0 0 auto;
    width: 160px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nearby-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); /* Smoother shadow */
    border-color: #ced4da;
}

.nearby-img-placeholder {
    width: 100%;
    height: 90px;
    background-color: #f8f9fa; /* Slightly lighter */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f3f5;
}

.nearby-img-icon {
    font-size: 32px;
    /* No grayscale, keeping original emoji colors or use a specific icon style */
    opacity: 0.9; 
    filter: grayscale(20%); /* Slight mute */
}

.nearby-info {
    padding: 12px;
}

.nearby-title {
    font-size: 14px;
    font-weight: 700;
    color: #333d4b;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.nearby-price {
    font-size: 15px; /* Slightly larger */
    font-weight: 800; /* Bolder */
    color: #333d4b;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.nearby-meta {
    font-size: 11px;
    color: #8b95a1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.nearby-tag {
    background-color: #f1f3f5;
    color: #6c757d;
    padding: 2px 5px;
    border-radius: 4px;
    /* border: 1px solid #e9ecef; Removed border for cleaner look */
    font-weight: 500;
}

/* =========================================
   CLS (Cumulative Layout Shift) Optimization
   ========================================= */

/* Reserve space for dynamically loaded area filter buttons */
#areaFilterContainer {
    min-height: 60px;
}

/* Reserve space for trend explanation content */
#trend-explanation {
    min-height: 80px;
}

/* Reserve space for district rank skeleton loader */
#district-rank-content {
    min-height: 140px;
}

/* Reserve space for jeonse ratio content */
#jeonse-ratio-content {
    min-height: 80px;
}

/* Reserve space for villa ranking table */
#ranking-table-container {
    min-height: 200px;
}

/* Reserve space for villa comparisons */
#villa-comparisons-container {
    min-height: 100px;
}

/* Contain ad layout to prevent affecting other elements */
.ad-container {
    contain: layout;
}

/* Ensure hero section price change indicator has stable height */
#hero-price-change {
    min-height: 21px;
}

/* FAQ Section Styles */
.faq-section {
    margin: 35px 15px;
    padding-top: 20px;
    border-top: 8px solid #f2f4f6; /* Divider style */
}

.faq-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.faq-container {
    border-top: 1px solid #f1f3f5;
}

.faq-item {
    border-bottom: 1px solid #f1f3f5;
}

.faq-item details {
    padding: 16px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.faq-item summary {
    font-size: 15px;
    font-weight: 600;
    color: #343a40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default triangle */
    padding-right: 5px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23868e96' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.faq-item details[open] summary::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding-top: 12px;
    padding-bottom: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #59616a;
    word-break: keep-all;
    white-space: pre-line;
}
