@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Default Theme: Trust & Intelligence (Blue) */
  --primary-color: #0f172a; /* Slate 900 */
  --primary-light: #334155; /* Slate 700 */
  --secondary-color: #3b82f6; /* Blue 500 */
  --secondary-dark: #2563eb; /* Blue 600 */
  --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  --accent-color: #0ea5e9; /* Sky 500 */
  --background-color: #f8fafc; /* Slate 50 */
  
  --card-bg: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.8);
  
  --text-main: #1e293b; /* Slate 800 */
  --text-sub: #64748b; /* Slate 500 */
  --border-color: #e2e8f0; /* Slate 200 */
  
  --success-text: #059669;
  --success-bg: #d1fae5;
  --error-text: #dc2626;
  --error-bg: #fee2e2;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-float: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme: Luxury Gold */
body.theme-gold {
  --primary-color: #1c1917; /* Stone 900 */
  --primary-light: #44403c; /* Stone 700 */
  --secondary-color: #d97706; /* Amber 600 */
  --secondary-dark: #b45309; /* Amber 700 */
  --secondary-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  --accent-color: #fbbf24; /* Amber 400 */
  --background-color: #fafaf9; /* Stone 50 */
  --text-main: #292524; /* Stone 800 */
  --text-sub: #78716c; /* Stone 500 */
  --border-color: #e7e5e4; /* Stone 200 */
  --success-text: #15803d; /* Green 700 */
}

/* Theme: Forest Green */
body.theme-green {
  --primary-color: #064e3b; /* Emerald 900 */
  --primary-light: #065f46; /* Emerald 800 */
  --secondary-color: #059669; /* Emerald 600 */
  --secondary-dark: #047857; /* Emerald 700 */
  --secondary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --accent-color: #34d399; /* Emerald 400 */
  --background-color: #f0fdf4; /* Emerald 50 */
  --text-main: #064e3b; /* Emerald 900 */
  --text-sub: #374151; /* Gray 700 */
  --border-color: #d1fae5; /* Emerald 100 */
}

/* Theme: Modern Purple */
body.theme-purple {
  --primary-color: #2e1065; /* Violet 950 */
  --primary-light: #4c1d95; /* Violet 900 */
  --secondary-color: #7c3aed; /* Violet 600 */
  --secondary-dark: #6d28d9; /* Violet 700 */
  --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --accent-color: #a78bfa; /* Violet 400 */
  --background-color: #f5f3ff; /* Violet 50 */
  --text-main: #1e1b4b; /* Indigo 950 */
  --text-sub: #5b21b6; /* Violet 800 */
  --border-color: #ede9fe; /* Violet 100 */
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background-color: #f1f5f9; /* Darker Slate 100 for better card contrast */
  /* Subtle technical grid pattern */
  background-image: 
    linear-gradient(rgba(203, 213, 225, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(203, 213, 225, 0.4) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center 0;
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

/* Theme Switcher UI */
.theme-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-right: 15px;
}

.theme-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.theme-btn:hover { transform: scale(1.2); }
.theme-btn.active { box-shadow: 0 0 0 2px var(--primary-color); transform: scale(1.1); }

.theme-btn-blue { background: #3b82f6; }
.theme-btn-gold { background: #d97706; }
.theme-btn-green { background: #059669; }
.theme-btn-purple { background: #7c3aed; }


/* Animation */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Glassmorphism Header - More Solid for Contrast */
.site-header {
  background: #0f172a !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 0;
  box-shadow: var(--shadow-md);
  transition: background 0.3s;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title a {
  font-weight: 800;
  font-size: 1.25rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}

.logo-icon { font-size: 1.5rem; }

.site-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.site-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1); /* slightly adjusted for themes */
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.breadcrumb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.breadcrumb a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--secondary-color); }

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: var(--border-color);
}

/* Main Content Layout */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
}

/* Hero Section: Deep & Intelligent */
.hero-section { margin-bottom: 3rem; }

.hero-background {
  background: var(--primary-color); /* Fallback */
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: 5rem 2rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: background 0.3s;
}

/* Abstract Pattern Overlay */
.hero-background::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
}

.hero-content { position: relative; z-index: 1; animation: fadeInScale 0.6s ease-out; }

.hero-icon { font-size: 3rem; margin-bottom: 1rem; display: inline-block; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  background: linear-gradient(to bottom right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  font-weight: 300;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.feature-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.6rem 1.25rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s;
}
.feature-item:hover { background: rgba(255, 255, 255, 0.2); }

/* Integrated Search Panel (Floating) */
.search-section-card {
  background: #f1f5f9; /* Contrast background */
  backdrop-filter: blur(12px);
  border: 1px solid white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  padding: 2.5rem;
  margin-top: -4rem; /* Overlap Hero */
  margin-bottom: 4rem;
  position: relative;
  z-index: 10;
  animation: fadeInScale 0.6s ease-out 0.1s backwards;
  transition: background-color 0.3s;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0; /* Removed margin to flush with input area if needed, or keep standard padding */
  padding: 1.5rem 2.5rem;
  background: linear-gradient(to right, rgba(236, 242, 245, 0.5), rgba(255, 255, 255, 0));
  border-bottom: 1px solid var(--border-color);
}

.search-header-left { display: flex; align-items: center; gap: 0.75rem; }

.search-icon { 
    font-size: 1.5rem; 
    background: white; 
    padding: 0.5rem; 
    border-radius: 50%; 
    color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.search-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  letter-spacing: -0.02em;
}

/* Enhanced Inputs */
.search-method-group { margin-bottom: 2rem; }

.method-label, .options-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-input-main, .coord-input, .option-input, .option-select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #cbd5e1; /* Darker border (Slate 300) */
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition-base);
  background: white;
  color: var(--text-main);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Inner input shadow */
}

.search-input-main:focus, .coord-input:focus, .option-input:focus, .option-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* Keep shadow blueish or transparent */
  outline: none;
}

.search-input-wrapper { display: flex; gap: 1rem; }
.coords-input-group { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* Buttons */
.btn {
  padding: 0 2rem;
  height: 3.5rem; /* Match input height */
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-base);
  border: none;
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap; /* Prevent text wrapping */
  flex-shrink: 0; /* Prevent shrinking in flex containers */
}

.btn-primary {
  background: var(--secondary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.1);
}

.btn-secondary {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    border-color: var(--text-sub);
    background: var(--background-color);
}

.btn-current-location {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 2rem;
    cursor: pointer;
    color: var(--secondary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-current-location:hover {
    border-color: var(--secondary-color);
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Dramatic Estimate Presentation */
.results-banner {
    display: none; /* Hide old banner */
}

.estimate-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* Stronger shadow */
  padding: 0;
  overflow: hidden;
  margin-bottom: 4rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: border-color 0.3s, transform 0.3s;
}
.estimate-card:hover { transform: translateY(-2px); }

.estimate-header {
  background: #0232a4;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.estimate-header h2 {
  margin: 0;
  font-size: 1rem;
  color: white;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.estimate-icon { font-size: 1.2rem; filter: brightness(0) invert(1); opacity: 1; }

.estimate-body { padding: 2rem; background: #f8fafc; }

.estimate-main-price {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .estimate-main-price {
    flex-direction: column;
    gap: 1rem;
  }
}

.price-per-m2, .price-per-tsubo {
  flex: 1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.price-per-m2::before, .price-per-tsubo::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--text-sub);
    opacity: 0.1;
    transition: background 0.3s;
}

.price-per-m2:hover, .price-per-tsubo:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary-color);
}
.price-per-m2:hover::before, .price-per-tsubo:hover::before {
    background: var(--secondary-color);
    opacity: 1;
}

.price-unit {
  display: block;
  font-size: 0.9rem;
  color: var(--text-sub);
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-amount {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: #3b82f6; /* Explicit Blue */
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Comparison & Params */
.estimate-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.comparison-label { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 0.25rem; font-weight: 600; }
.comparison-values { display: flex; flex-direction: column; gap: 2px; }
.comparison-values span { font-family: 'Inter', sans-serif; font-weight: 700; color: var(--text-main); font-size: 1.2rem; }
.comparison-values .small-text { color: var(--text-sub); font-size: 0.9rem; font-weight: 400; margin-left: 0; }

@media (min-width: 640px) {
  .comparison-values { flex-direction: row; align-items: baseline; gap: 1rem; }
  .comparison-values .small-text { margin-left: 0.5rem; }
}

.comparison-change {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    min-width: 100px;
}
.comparison-change.positive { background: #dcfce7; color: #15803d; }
.comparison-change.negative { background: #fee2e2; color: #b91c1c; }

.change-label { font-size: 0.65rem; text-transform: uppercase; display: block; opacity: 0.8; margin-bottom: 0; }
.change-value { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; }

.estimate-params {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.param-item {
    font-size: 0.85rem;
    color: var(--text-sub);
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.param-item strong { color: var(--text-main); font-weight: 600; }

/* Map & Base Point */
.results-section { margin-bottom: 3rem; }
.base-point-card {
    background: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.base-point-header { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--text-sub); font-size: 0.9rem; }
.base-point-address { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.base-point-coords { font-family: 'Inter', monospace; color: var(--text-sub); font-size: 0.9rem; }

#map {
    height: 400px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Comps Dashboard Table */
.comp-table-wrapper {
    margin-top: 2rem;
    overflow-x: auto;
}

.comp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.comp-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: white;
  letter-spacing: 0.05em;
  padding: 1rem;
  border: none;
  background: var(--primary-light);
  text-align: left;
}

.comp-table th:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.comp-table th:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

.comp-table tr { background: transparent; }

.comp-table tbody tr {
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.comp-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.comp-table td {
  background: white;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

.comp-table td:first-child {
  border-left: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.comp-table td:last-child {
  border-right: 1px solid var(--border-color);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

/* Table Cells */
.comp-number { background: var(--text-sub); color: white; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.badge-koji { background: #e0f2fe; color: #0284c7; padding: 0.25rem 0.75rem; border-radius: 1rem; font-weight: 600; font-size: 0.75rem; }
.badge-pref { background: #dcfce7; color: #16a34a; padding: 0.25rem 0.75rem; border-radius: 1rem; font-weight: 600; font-size: 0.75rem; }

.address-cell a { color: var(--text-main); font-weight: 600; text-decoration: none; }
.address-cell a:hover { color: var(--secondary-color); text-decoration: underline; }

.price-cell { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--text-main); }
.weight-cell { color: var(--secondary-color); font-weight: 700; font-family: 'Inter', monospace; opacity: 0.8; }

.change-cell { font-family: 'Inter', sans-serif; font-weight: 700; }
.change-cell.positive { color: var(--success-text); }
.change-cell.negative { color: var(--error-text); }

/* Footer */
.site-footer {
  background: var(--primary-color);
  color: white;
  padding: 5rem 1.5rem 2rem;
  margin-top: 5rem;
  border-top: 5px solid var(--secondary-color);
  transition: background 0.3s, border-color 0.3s;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-section h3 {
  color: var(--secondary-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: 0.8rem; }

.footer-section a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
}
.footer-section a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .site-nav { 
        position: absolute; top: 100%; left: 0; right: 0;
        background: #0f172a;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        padding: 1rem;
        backdrop-filter: blur(10px);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .site-nav.active { display: flex; }
    .site-nav a { width: 100%; text-align: center; padding: 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    
    .hero-title { font-size: 2.25rem; }
    .search-section-card { margin-top: 0; margin-bottom: 2rem; padding: 1.5rem; }
    .estimate-main-price { grid-template-columns: 1fr; gap: 1rem; }
    .price-amount { font-size: 2.5rem; }
    .search-input-wrapper { flex-direction: column; }
    .coords-input-group { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    
    .search-input-wrapper .btn,
    .coords-input-group .btn { width: 100%; justify-content: center; }
    
    .search-btn-wrapper { width: 100%; }
    
    /* Table Scroll */
    .comp-table-wrapper { -webkit-overflow-scrolling: touch; }
    
    /* Mobile Cards */
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    .comp-card { background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 1rem; border: 1px solid var(--border-color); }
    .comp-card-header { padding: 1rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; background: transparent; color: var(--text-main); }
    .comp-card-body { padding: 1rem; }
    .comp-weight { color: var(--text-sub); }
}

@media (min-width: 769px) {
    .mobile-only { display: none; }
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  text-align: center;
  padding: 30px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-color);
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.9rem;
  color: var(--text-sub);
}

/* Active Highlight */
.comp-table tr.active-highlight,
.comp-card.active-highlight {
  background-color: #d1fae5 !important;
  transform: scale(1.005);
  box-shadow: 0 0 0 2px #10b981, var(--shadow-md) !important;
  z-index: 10;
  position: relative;
  transition: all 0.3s ease;
}

.comp-table tr.active-highlight td {
  background-color: #d1fae5 !important;
  border-color: #10b981;
}

/* --- Search Tabs & Form Improvements --- */
.search-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  gap: 1rem;
}

.search-tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}

.search-tab-btn.active {
  color: var(--secondary-color);
}

.search-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--secondary-color);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Inputs */
.search-input-main {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  background: #f8fafc;
}

.search-input-main:focus {
  background: white;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.coord-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Inter', monospace;
}

/* --- Table Design Upgrade2 --- */
.comp-table-wrapper {
  margin-top: 2rem;
  overflow-x: auto;
}

/* Desktop: Allow sticky header to stick to viewport */
@media (min-width: 1024px) {
  .comp-table-wrapper {
    overflow-x: visible;
  }
}

.comp-table th {
  position: sticky;
  top: 80px; /* Increased to 80px to safely clear the site header */
  z-index: 50; /* Ensure it stays above content */
  background: #f8fafc; /* Ensure solid background, matches body/header tone */
  border-bottom: 2px solid #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); /* Stronger shadow to delimit header */
  white-space: nowrap;
  
  /* Reset any potential conflicting transforms */
  transform: none;
}

.comp-table td {
  border-bottom: 1px solid #f1f5f9; /* Lighter borders */
}

/* Text Alignment Helpers */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'Inter', monospace; font-feature-settings: 'tnum'; }

/* --- Mobile Grid Improvement --- */
@media (max-width: 768px) {
  .comp-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem; 
  }
  
  .detail-item {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .detail-label {
    margin-bottom: 0;
    white-space: nowrap;
  }
}


/* --- Refined Design Improvements --- */

/* 1. Layout & Spacing */
.formatted-section {
    margin-bottom: 2.5rem; /* Unified margin */
}

/* 2. Mobile Card Header - Left/Right Split */
.comp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

/* 3. Highlight Accent Bar - Adjusted to avoid stacking/transform issues */
.active-highlight {
    /* Existing override + Accent Bar */
    border-left: 6px solid #10b981 !important; /* Green accent */
    background-color: #f0fdf4 !important; /* Lighter emerald bg */
    box-shadow: 0 0 0 2px #10b981, var(--shadow-md) !important;
    position: relative;
    z-index: 10;
    /* REMOVED scale transform to prevent stacking context conflict with sticky header */
    transform: none !important; 
}

/* Remove default border radius on left if using accent bar to look sharp */
.comp-table tr.active-highlight td:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.comp-card.active-highlight {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 4. Table Header Refinement - integrated into main rule */
.comp-table th {
    color: #475569 !important; /* Dark slate text for visibility */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    /* other props handled in main rule */
}
/* Consolidated into main .comp-table th rule above */

/* 5. Mobile Details Grid Enhancement */
.detail-item {
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.price-main .price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
}


/* Section Title styling */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color) !important;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 5px solid var(--secondary-color);
  letter-spacing: -0.02em;
}


/* Fix Table Header Visibility */
.comp-table th {
    color: var(--text-sub) !important; /* switch from white to dark gray */
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}


/* --- Refinement Phase: Unified Block Design & Cool Factors --- */

/* 1. Content Cards - The Unified Standard */
.content-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03); 
    /* Slightly lighter shadow for cleaner look */
    margin-bottom: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6); /* Very subtle border */
    transition: transform 0.3s, box-shadow 0.3s;
}

.content-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08); /* Lift effect */
}

/* 2. Color Variations for Sections */

/* Estimate Card (Result) - Premium Gold/Blue Top Border */
.card-estimate {
    border-top: 6px solid var(--secondary-color); /* Blue top bar */
}

/* Search Card (Action) - Subtle Slate/Blue */
.card-search {
    border-top: 6px solid #64748b; /* Slate accent */
}

/* Base Point / Map Info - Red Accent (Location) */
.card-base-point {
    border-top: 6px solid #ef4444; /* Red accent */
    padding: 1.5rem;
    background: #fffafa; /* Very faint red tint bg? or keep white */
}

/* Map Container - Full width inside card */
#map {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Accordion Animation */
.search-accordion-content {
  max-height: 0; /* Initially hidden */
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
  transform-origin: top;
}

.search-accordion-content.open {
  max-height: 2000px; /* Sufficient height to show content */
  opacity: 1;
  margin-top: 2rem;
  animation: poyon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes poyon {
  0% { transform: scaleY(0.7); opacity: 0; }
  50% { transform: scaleY(1.05); opacity: 1; }
  70% { transform: scaleY(0.95); }
  100% { transform: scaleY(1); }
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--primary-color, #2563eb);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
  font-size: 1.5rem;
  font-weight: bold;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background-color: #1d4ed8;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Navigation Links (Accordion Toggle & Map) */
.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.accordion-toggle-btn {
  background-color: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.accordion-toggle-btn:hover {
  background-color: #dbeafe;
  transform: translateY(-1px);
}
.accordion-toggle-btn::after {
  content: "▼";
  display: inline-block;
  font-size: 0.6em;
  margin-left: 4px;
  transition: transform 0.2s;
}
.accordion-toggle-btn.open::after {
  transform: rotate(180deg);
}
/* Open state styling can be handled by JS adding a class, or just keep it simple */

.map-scroll-btn {
  background-color: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}
.map-scroll-btn:hover {
  background-color: #f1f5f9;
  color: #475569;
}


/* 3. Typography & spacing refinements */
.base-point-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.base-point-body {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #475569;
}

.param-badge {
    display: inline-block;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    color: #475569;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 4. Table Header Refinement - integrated into main rule */
.comp-table th {
    color: #475569 !important; /* Dark slate text for visibility */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    /* other props handled in main rule */
}

/* 5. Estimate Price Pop */
.estimate-main-price .price-amount {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(37,99,235,0.2));
}

/* 6. Search Tabs - Segmented Control Look */
.search-tabs {
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.75rem;
    display: inline-flex;
    gap: 0.25rem;
    border: none;
    margin-bottom: 2rem;
}

.search-tab-btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-tab-btn.active {
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-tab-btn.active::after { display: none; } /* Remove underline style */


/* Mobile Optimization for Estimate Price Cards */
@media (max-width: 768px) {
  .estimate-main-price {
    display: grid; /* Use Grid */
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 0.75rem; /* Tighter gap */
  }

  .price-per-m2, .price-per-tsubo {
    padding: 1.5rem 0.5rem; /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%; /* Force full width within grid cell */
    box-sizing: border-box;
  }

  .comparison-label { white-space: nowrap; }

  .price-amount {
    font-size: 1.5rem; /* Even smaller font size to fit safely */
    white-space: nowrap; /* Prevent wrapping if possible */
  }

  /* Make Comparison Block also denser on mobile */
  .estimate-comparison {
    padding: 1rem;
    flex-direction: row; /* Keep row even on mobile if possible, or stack */
    gap: 1rem;
  }
}


/* Mobile Size Fix */
@media (max-width: 768px) {
  .content-card {
    border-radius: var(--radius-md); /* Slightly reduced radius for mobile */
  }

  /* Force full width minus padding for inner containers */
  .estimate-comparison {
      width: 100%;
      box-sizing: border-box;
      flex-direction: row; 
      justify-content: space-between;
  }
}


/* Mobile Optimization - Maximize Width */
@media (max-width: 768px) {
  .estimate-body {
    padding: 1rem !important; /* Reduce padding to give more space to content */
  }
  
  .estimate-main-price {
    gap: 0.5rem; /* Reduce gap slightly */
  }
}

/* Loading Spinner & Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-bg, rgba(255, 255, 255, 0.8));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex !important; /* Force display when active */
}

.loading-content {
  text-align: center;
  padding: 30px;
  background: white;
  border-radius: var(--radius-xl, 24px);
  box-shadow: var(--shadow-float, 0 20px 25px -5px rgba(0,0,0,0.1));
  border: 1px solid var(--border-color, #e2e8f0);
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid var(--border-color, #e2e8f0);
  border-top: 4px solid var(--secondary-color, #3b82f6);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.9rem;
  color: var(--text-sub, #64748b);
}

/* --- Input Clear Button (x mark) --- */
.btn-clear-input {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    display: none; /* JS will toggle this */
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
    transition: all 0.2s;
}

.btn-clear-input:hover {
    background: #cbd5e1;
    color: #334155;
}

.input-clear-wrapper:hover .btn-clear-input,
.input-clear-wrapper input:focus + .btn-clear-input,
.input-clear-wrapper input:not(:placeholder-shown) + .btn-clear-input {
    display: flex;
}

/* --- Improved Nav Action Buttons (Condition / Map) --- */
.location-nav-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap; 
}

.nav-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 9999px; /* Pill shape */
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.nav-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    text-decoration: none;
}

.nav-action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1em;
    line-height: 1;
}

/* Specific button styles */
.btn-search-toggle {
    background-color: #f0f9ff; /* Light Blue */
    color: #0284c7; /* Sky 600 */
    border-color: #bae6fd;
}

.btn-search-toggle:hover {
    background-color: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

.btn-search-toggle.open {
    background-color: #bae6fd;
    color: #0c4a6e;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn-map-scroll {
    background-color: #ffffff;
    color: #475569; /* Slate 600 */
    border-color: #e2e8f0; /* Slate 200 */
}

.btn-map-scroll:hover {
    background-color: #f8fafc;
    color: #1e293b;
    border-color: #94a3b8;
}

/* Mobile Adjustments for Buttons */
@media (max-width: 640px) {
    .location-nav-links {
        width: 100%;
        gap: 0.75rem;
    }
    
    .nav-action-btn {
        flex: 1; /* Stretch buttons to fill width */
        justify-content: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}


/* Index Page Specifics */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.address-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.address-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.address-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 700;
}

.address-info {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.address-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.initial-filter {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.initial-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.initial-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--background-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.initial-btn:hover, .initial-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.news-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-top: 50px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--secondary-color);
}

.news-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    flex-wrap: wrap;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.news-date {
    font-weight: 700;
    color: var(--secondary-color);
    width: 120px;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}

.news-content {
    color: var(--text-main);
    flex: 1;
}

.level-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Enhanced Design for Price Page */
.estimate-card {
    background: linear-gradient(to bottom, #ffffff, #f8faff);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.estimate-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 1.5rem 2rem;
}

.estimate-header h2 {
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.js-btn-current {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    backdrop-filter: blur(4px);
}
.js-btn-current:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
    transform: translateY(-1px);
}

.estimate-main-price {
    gap: 20px;
}

.price-per-m2, .price-per-tsubo {
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: white;
    position: relative;
    overflow: hidden;
}

.price-per-m2::after, .price-per-tsubo::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.price-amount {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.ai-summary-section {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Comp Cards (Mobile) */
.comp-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.comp-card-header {
    background: #f1f5f9;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

.comp-number {
    background: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.badge-koji {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.badge-pref {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}


/* Compact Header Search for Price Page */
.compact-search-header {
    background-image: url('/img/hero_bg.png');
    background-size: cover;
    background-position: center;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-top: -20px; /* pull up to override breadcrumb gap if needed */
}

.compact-search-overlay {
    background: rgba(15, 23, 42, 0.85);
    position: absolute; 
    top:0; left:0; right:0; bottom:0;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.compact-search-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.compact-search-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.compact-search-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}

.compact-input-wrapper {
    display: flex;
    gap: 10px;
}

@media (max-width: 640px) {
    .compact-input-wrapper {
        flex-direction: column;
    }
    .compact-input-wrapper .btn {
        width: 100%;
    }
}


/* Styles for Integrated Tabs in Header */
.header-tab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.header-tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.header-tab-btn.active {
    background: white;
    color: var(--secondary-color);
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-panel { display: none; }
.header-panel.active { display: block; animation: fadeInScale 0.3s ease-out; }


/* Layout for Price Display */
.estimate-main-price {
    display: flex;
    gap: 20px;
}

@media (max-width: 640px) {
    .estimate-main-price {
        flex-direction: column; 
    }
}

.price-per-m2, .price-per-tsubo {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    border-radius: 16px;
}

.price-unit {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block; 
}

.price-amount {
    font-size: 2.5rem; /* Larger font */
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}


/* Layout for Map Integration in Estimate Card */
.estimate-layout-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: start;
}

.estimate-left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.estimate-right-col {
    height: 100%;
    min-height: 450px;
}

/* Map specific styles inside card */
.estimate-right-col #map {
    width: 100%;
    height: 100%;
    min-height: 450px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 1024px) {
    .estimate-layout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .estimate-right-col, .estimate-right-col #map {
        min-height: 350px;
    }
}


/* Styles for Current Location Button in Main Header */
.btn-header-current {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 20px;
    height: 40px;
}

.btn-header-current:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-header-current svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .btn-header-current {
        display: none; /* Hide on mobile to save space */
    }
}


/* Mobile Menu Current Location Button */
.nav-location-btn {
    display: none; /* hidden on desktop */
    margin: 10px 0;
    width: 100%;
    justify-content: center;
    background: var(--secondary-color) !important;
    border: none !important;
    font-weight: 700 !important;
}

@media (max-width: 768px) {
    .nav-location-btn {
        display: flex;
        padding: 12px !important;
    }
}


/* --- Fix: Mobile Navigation & Header Layout --- */

@media (max-width: 900px) { /* Increased breakpoint to catch tablets */
    
    /* 1. Hide the Header's 'Current Location' button */
    .btn-header-current { 
        display: none !important; 
    }

    /* 2. Show Hamburger Toggle */
    .menu-toggle {
        display: block;
        margin-left: auto; /* Push to right */
        font-size: 1.8rem;
    }

    /* 3. Mobile Navigation Drawer */
    .site-nav {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0f172a; /* Match header dark theme */
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 1000;
    }

    .site-nav.active {
        display: flex;
        animation: slideDown 0.2s ease-out forwards;
    }

    /* Mobile Nav Links */
    .site-nav a {
        display: block;
        padding: 1rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: rgba(255,255,255,0.9);
        font-size: 1rem;
    }
    
    .site-nav a:last-child {
        border-bottom: none;
    }
    
    .site-nav a:hover {
        background: rgba(255,255,255,0.05);
    }
}

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

/* Fix Title text wrap on small screens */
@media (max-width: 400px) {
    .site-title a {
        font-size: 1rem; /* Smaller font */
    }
    .logo-icon {
        font-size: 1.2rem;
    }
}

/* Ensure mobile button inside menu is visible */
@media (max-width: 900px) {
    .nav-location-btn {
        display: flex !important;
        margin-bottom: 1rem;
    }
}


/* Force PC Navigation Layout */
@media (min-width: 901px) {
    .site-nav {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        align-items: center !important;
        gap: 0.5rem !important;
        animation: none !important;
    }
    
    .site-nav a {
        display: inline-block !important; /* Force inline */
        width: auto !important;
        border: none !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Hide the mobile button in PC menu */
    .nav-location-btn {
        display: none !important;
    }
}


/* Mobile Header Location Arrow */
.btn-mobile-location {
    display: none;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    margin-right: 5px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}

.btn-mobile-location:hover {
    background: rgba(255,255,255,0.1);
}

.btn-mobile-location svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

@media (max-width: 900px) {
    .btn-mobile-location {
        display: flex;
    }
}


/* Merge Estimate Card with Compact Header */
.compact-search-header {
    margin-bottom: 0 !important;
    border-radius: 0 !important; /* Flatten bottom */
    padding-bottom: 3rem !important; /* Extend background slightly */
}
.compact-search-overlay {
    border-radius: 0 !important;
}

.estimate-card {
    margin-top: -1rem !important; /* Pull up to touch header */
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top: none !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important; /* Remove top shadow overlap if needed */
}

/* Adjust estimate body padding since header is gone */
.estimate-body {
    padding-top: 2rem !important;
}


/* Layout Fixes for Index Page */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.address-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 16px !important;
}

.address-card {
    padding: 16px !important; /* Consistent compact padding */
}

/* Adjust Region Titles */
.region-title {
    margin-top: 3rem !important;
    font-size: 1.5rem !important;
    color: var(--primary-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 1.5rem !important;
}

