/* ═══════════════════════════════════════════════════════════════════════════
   Apartment Finder - Sophisticated Gallery Style
   "Luxury is in each detail." - Hubert de Givenchy
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   Typography - Google Fonts
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   Design Tokens
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --color-base: #FEFCF8;
  --color-primary: #1A1A1A;
  --color-navy: #0A1628;
  --color-bronze: #B8860B;
  --color-bronze-light: #D4A84B;
  --color-muted: #6B6B6B;
  --color-subtle: #E8E4DC;
  --color-error: #8B3A3A;
  --color-success: #3A6B3A;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Spacing - Swiss grid inspired */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Transitions */
  --ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-primary);
  background-color: var(--color-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 500;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-navy);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-elegant);
}

a:hover {
  color: var(--color-bronze);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Lucide Icons
   ───────────────────────────────────────────────────────────────────────────── */
.icon-16 {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Layout
   ───────────────────────────────────────────────────────────────────────────── */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Header
   ───────────────────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  padding: var(--space-md) 0 var(--space-lg);
}

header h1 {
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
}

.header-title-link {
  text-decoration: none;
  color: inherit;
}

.subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-image {
  display: block;
  max-width: 100%;
  width: 8rem;
  height: auto;
  margin: 0 auto var(--space-sm);
  opacity: 0.85;
  transition: opacity var(--duration-normal) var(--ease-elegant);
  border-radius: 0.75rem;
}

.header-image:hover {
  opacity: 1;
}

/* Language Selector */
.lang-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-sm);
}

.lang-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-bottom: 1.5px solid transparent;
  transition: color var(--duration-fast) var(--ease-elegant),
              border-color var(--duration-fast) var(--ease-elegant);
}

.lang-btn:hover {
  color: var(--color-bronze-light);
}

.lang-btn.active {
  color: var(--color-bronze);
  border-bottom-color: var(--color-bronze);
}

.lang-divider {
  width: 1px;
  height: 0.875rem;
  background-color: var(--color-subtle);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Sections - Gallery Style
   ───────────────────────────────────────────────────────────────────────────── */
section {
  background: transparent;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--duration-slow) var(--ease-elegant),
              transform var(--duration-slow) var(--ease-elegant);
}

section.fade-in {
  animation: fadeInUp var(--duration-slow) var(--ease-elegant) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section h2 {
  color: var(--color-navy);
  margin-bottom: var(--space-md);
  position: relative;
  text-align: center;
}

section h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 2px;
  background: var(--color-bronze);
  margin: var(--space-sm) auto 0;
}

.hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Retrieve Section
   ───────────────────────────────────────────────────────────────────────────── */
.retrieve-section {
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: var(--space-md);
  background: rgba(10, 22, 40, 0.02);
  border: 1px solid var(--color-subtle);
  margin-bottom: var(--space-lg);
}

.retrieve-section h2::after {
  display: none;
}

.retrieve-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-xs);
}

.retrieve-form input {
  width: 100%;
  max-width: 14rem;
  padding: var(--space-sm) 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-subtle);
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color var(--duration-normal) var(--ease-elegant);
}

.retrieve-form input::placeholder {
  color: var(--color-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.retrieve-form input:focus {
  outline: none;
  border-bottom-color: var(--color-bronze);
}

.retrieve-form input:focus-visible {
  outline: none;
  box-shadow: 0 2px 0 0 var(--color-bronze);
}

.retrieve-section small {
  display: block;
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 300;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Share Section
   ───────────────────────────────────────────────────────────────────────────── */
.share-section {
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: rgba(10, 22, 40, 0.03);
  border: 1px solid var(--color-subtle);
  text-align: center;
}

.share-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.share-label {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-navy);
}

.share-section code {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-bronze);
  background: transparent;
  padding: var(--space-xs) var(--space-sm);
  letter-spacing: 0.1em;
}

.share-section .btn-icon {
  width: 2rem;
  height: 2rem;
}

.share-section .btn-icon svg {
  width: 14px;
  height: 14px;
}

.copy-feedback {
  font-size: 0.75rem;
  color: var(--color-success);
  font-weight: 500;
  animation: fadeIn var(--duration-fast) var(--ease-elegant);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.share-section small {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 300;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Single Apartment Section
   ───────────────────────────────────────────────────────────────────────────── */
.single-apartment-section {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-md);
  background: rgba(10, 22, 40, 0.02);
  border: 1px solid var(--color-subtle);
  margin-bottom: var(--space-lg);
}

.single-apartment-section h2::after {
  display: none;
}

/* Section Toggle Button */
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.section-toggle h2 {
  margin: 0;
  flex: 1;
  text-align: center;
  transition: color var(--duration-fast) var(--ease-elegant);
}

.section-toggle:hover h2 {
  color: var(--color-bronze);
}

.section-toggle:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 4px;
}

.toggle-icon {
  width: 1.5rem;
  height: 1.5rem;
  position: relative;
  flex-shrink: 0;
}

.toggle-icon::before,
.toggle-icon::after {
  content: '';
  position: absolute;
  background: var(--color-navy);
  transition: transform var(--duration-normal) var(--ease-elegant);
}

.toggle-icon::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.toggle-icon::after {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.section-toggle[aria-expanded="true"] .toggle-icon::after {
  transform: translateX(-50%) rotate(90deg);
}

/* Section Content - Collapsible */
.section-content {
  overflow: visible;
  transition: max-height var(--duration-normal) var(--ease-elegant),
              opacity var(--duration-normal) var(--ease-elegant),
              margin-top var(--duration-normal) var(--ease-elegant);
  max-height: 2000px;
  opacity: 1;
  margin-top: var(--space-md);
}

.section-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.single-result-container {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-subtle);
}

.single-result-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-md);
  text-align: center;
}

.single-result-card {
  background: var(--color-base);
  border: 1px solid var(--color-subtle);
  padding: var(--space-md);
}

.single-apartment-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: var(--space-md);
}

.single-result-address {
  margin-bottom: var(--space-sm);
}

.single-result-address a {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-navy);
  display: block;
}

.single-result-address a:hover {
  color: var(--color-bronze);
}

.single-result-address .district {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.single-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-subtle);
}

.single-result-details .price {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-navy);
}

.single-result-details .size,
.single-result-details .rooms,
.single-result-details .price-sqm {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.single-travel-times h4 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.single-travel-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(232, 228, 220, 0.5);
}

.single-travel-time:last-of-type {
  border-bottom: none;
}

.single-travel-time .dest-name {
  font-weight: 500;
  color: var(--color-navy);
  min-width: 8rem;
}

.single-travel-time .time-value {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-bronze);
}

.single-travel-time .time-range {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.single-travel-time .transfers,
.single-travel-time .walk {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.single-total-time {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-subtle);
  font-family: var(--font-mono);
  color: var(--color-navy);
}

.single-result-actions {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.single-result-actions .btn-ai-feedback {
  width: auto;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Form Styles
   ───────────────────────────────────────────────────────────────────────────── */
.form-section {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-md);
  background: rgba(10, 22, 40, 0.02);
  border: 1px solid var(--color-subtle);
  margin-bottom: var(--space-lg);
}

.form-section h2::after {
  display: none;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.01em;
  text-align: center;
}

.form-group input[type="url"],
.form-group input[type="text"],
.form-group input[type="number"] {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: var(--space-sm) 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-subtle);
  transition: border-color var(--duration-normal) var(--ease-elegant);
  text-align: center;
}

/* Number input - refined spinner styling */
.form-group input[type="number"] {
  -moz-appearance: textfield;
  max-width: 10rem;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-group input::placeholder {
  color: var(--color-muted);
  font-weight: 300;
}

.form-group input:focus {
  outline: none;
  border-bottom-color: var(--color-bronze);
}

.form-group input:focus-visible {
  outline: none;
  box-shadow: 0 2px 0 0 var(--color-bronze);
}

.form-group small {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 300;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Destinations
   ───────────────────────────────────────────────────────────────────────────── */
#destinations-container {
  margin-bottom: var(--space-md);
}

#add-destination,
#add-single-destination {
  display: block;
  margin: 0 auto;
}

.destination-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  align-items: flex-end;
  padding-bottom: var(--space-xs);
  justify-content: center;
}

.destination-row .dest-name,
.destination-row .dest-address {
  max-width: none;
  margin: 0;
  flex: 1;
  max-width: 14rem;
}

.btn-remove {
  flex: 0 0 2.5rem;
  height: 2.5rem;
  background: transparent;
  color: var(--color-muted);
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-elegant),
              color var(--duration-fast) var(--ease-elegant);
}

.btn-remove:hover:not(:disabled) {
  opacity: 1;
  color: var(--color-error);
}

.btn-remove:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.btn-remove:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

/* Save Address Button */
.btn-save-address {
  flex: 0 0 2.5rem;
  height: 2.5rem;
  background: transparent;
  color: var(--color-muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-elegant),
              color var(--duration-fast) var(--ease-elegant);
}

.btn-save-address:hover {
  opacity: 1;
  color: var(--color-bronze);
}

.btn-save-address.saved {
  color: var(--color-success);
  opacity: 1;
}

.btn-save-address:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

/* Saved Addresses Section */
.saved-addresses-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-subtle);
}

.saved-addresses-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.saved-addresses-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}

.saved-addresses-empty {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-style: italic;
}

.saved-addresses-empty.hidden {
  display: none;
}

.saved-address-item {
  display: inline-flex;
  align-items: stretch;
  background: rgba(10, 22, 40, 0.03);
  border: 1px solid var(--color-subtle);
  transition: border-color var(--duration-fast) var(--ease-elegant);
}

.saved-address-item:hover {
  border-color: var(--color-bronze);
}

.saved-address-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) var(--ease-elegant);
}

.saved-address-btn:hover {
  background: rgba(184, 134, 11, 0.08);
}

.saved-address-btn .saved-name {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-navy);
}

.saved-address-btn .saved-addr {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  color: var(--color-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-address-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-width: 2.75rem;
  background: transparent;
  border: none;
  border-left: 1px solid var(--color-subtle);
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1rem;
  opacity: 0.6;
  transition: all var(--duration-fast) var(--ease-elegant);
}

.saved-address-delete:hover {
  opacity: 1;
  color: var(--color-error);
  background: rgba(139, 58, 58, 0.08);
}

.saved-address-delete:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: -2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-elegant);
}

.btn-primary {
  background: var(--color-navy);
  color: var(--color-base);
}

.btn-primary:hover {
  background: var(--color-primary);
}

.btn-primary:disabled {
  background: var(--color-subtle);
  color: var(--color-muted);
  cursor: not-allowed;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 4px;
}

.btn-secondary {
  background: transparent;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
}

.btn-secondary:hover {
  background: var(--color-navy);
  color: var(--color-base);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 4px;
}

.btn-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.btn-danger:hover {
  background: var(--color-error);
  color: var(--color-base);
}

.btn-danger:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 4px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 1px solid var(--color-subtle);
  cursor: pointer;
  color: var(--color-primary);
  transition: all var(--duration-fast) var(--ease-elegant);
}

.btn-icon:hover {
  border-color: var(--color-bronze);
  color: var(--color-bronze);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

.form-actions {
  text-align: center;
  margin-top: var(--space-lg);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Progress Section
   ───────────────────────────────────────────────────────────────────────────── */
.progress-section {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.progress-header h2 {
  margin: 0;
}

.progress-header h2::after {
  display: none;
}

.progress-bar-container {
  height: 3px;
  background: var(--color-subtle);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-navy), var(--color-bronze));
  width: 0%;
  transition: width var(--duration-normal) var(--ease-elegant);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.phase-indicator {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-navy);
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.progress-message {
  padding: var(--space-md);
  background: rgba(10, 22, 40, 0.03);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-muted);
  min-height: 3.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Results Section
   ───────────────────────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.results-header h2 {
  margin: 0;
}

.results-header h2::after {
  display: none;
}

#results-count {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-muted);
  margin-left: var(--space-sm);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sort-controls label {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 400;
}

.sort-controls select {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-primary);
  background: transparent;
  border: 1px solid var(--color-subtle);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-elegant);
}

.sort-controls select:hover {
  border-color: var(--color-bronze);
}

.sort-controls select:focus {
  outline: none;
  border-color: var(--color-bronze);
}

.sort-controls select:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Table - Gallery Presentation
   ───────────────────────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-subtle);
}

th {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: transparent;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--duration-fast) var(--ease-elegant);
}

th.sortable:hover {
  color: var(--color-bronze);
}

th.sortable.active {
  color: var(--color-bronze);
}

tbody tr {
  transition: background-color var(--duration-fast) var(--ease-elegant);
}

tbody tr:hover {
  background: rgba(184, 134, 11, 0.04);
}

.address-cell {
  max-width: 20rem;
}

.address-cell a {
  font-weight: 500;
  color: var(--color-navy);
}

.address-cell a:hover {
  color: var(--color-bronze);
}

.address-cell .district {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.address-with-image {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.apartment-thumbnail {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background-color: var(--color-subtle);
  cursor: zoom-in;
}

.apartment-thumbnail:hover {
  outline: 2px solid var(--color-bronze);
}

/* Image preview popup */
.image-preview-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(600px, calc(100vw - 2rem));
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  pointer-events: none;
}

.address-info {
  min-width: 0;
}

.price-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-navy);
}

.price-per-sqm-cell {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--color-muted);
}

.travel-time-cell {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.travel-time-cell .time-avg {
  font-weight: 500;
  color: var(--color-navy);
}

.travel-time-cell .time-range {
  display: block;
  font-size: 0.75rem;
  color: var(--color-bronze);
  margin-top: 0.125rem;
}

.travel-time-cell .transfers {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.125rem;
}

.travel-time-cell .walk-distance {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.125rem;
  font-style: italic;
}

.travel-time-cell .car-time {
  display: block;
  font-size: 0.75rem;
  color: var(--color-bronze);
  margin-top: 0.25rem;
  font-weight: 500;
}

.travel-time-cell .bicycle-time {
  display: block;
  font-size: 0.75rem;
  color: #2e7d32;
  margin-top: 0.125rem;
  font-weight: 500;
}

.total-time-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-bronze);
}

.results-actions {
  text-align: center;
  margin-top: var(--space-xl);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Filter Panel
   ───────────────────────────────────────────────────────────────────────────── */
.header-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.btn-small {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8125rem;
}

/* Button with icon and text */
.btn-primary .icon-16,
.btn-secondary .icon-16 {
  vertical-align: -0.125em;
  margin-right: 0.375em;
}

#active-filters-count:not(:empty) {
  display: inline-block;
  background: var(--color-bronze);
  color: var(--color-base);
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  margin-left: 0.375rem;
  font-weight: 600;
}

.filter-panel {
  background: rgba(10, 22, 40, 0.02);
  padding: var(--space-md);
  margin: 0 auto var(--space-lg);
  border: 1px solid var(--color-subtle);
  max-width: 50rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-md) var(--space-lg);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-group-wide {
  grid-column: 1 / -1;
}

.filter-group label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-navy);
  letter-spacing: 0.02em;
}

.filter-group input[type="number"] {
  padding: var(--space-xs) 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-subtle);
  transition: border-color var(--duration-normal) var(--ease-elegant);
  max-width: 8rem;
  -moz-appearance: textfield;
  text-align: center;
}

.filter-group input[type="number"]::-webkit-outer-spin-button,
.filter-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-group input[type="number"]::placeholder {
  color: var(--color-muted);
  font-weight: 300;
}

.filter-group input[type="number"]:focus {
  outline: none;
  border-bottom-color: var(--color-bronze);
}

.filter-group input[type="number"]:focus-visible {
  outline: none;
  box-shadow: 0 2px 0 0 var(--color-bronze);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.range-inputs input {
  flex: 1;
}

.range-separator {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--color-primary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-elegant);
  /* Larger touch target */
  padding: 0.375rem 0.25rem;
  margin: -0.375rem -0.25rem;
}

.checkbox-group label:hover {
  color: var(--color-bronze);
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--color-subtle);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-elegant);
  position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
  background: var(--color-navy);
  border-color: var(--color-navy);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--color-base);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-group input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

/* Inline checkbox for form options */
.checkbox-group-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.checkbox-group-inline .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-primary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-elegant);
}

.checkbox-group-inline .checkbox-label:hover {
  color: var(--color-bronze);
}

.checkbox-group-inline input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid var(--color-subtle);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-elegant);
  position: relative;
  flex-shrink: 0;
}

.checkbox-group-inline input[type="checkbox"]:checked {
  background: var(--color-navy);
  border-color: var(--color-navy);
}

.checkbox-group-inline input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 5px;
  height: 9px;
  border: solid var(--color-base);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.checkbox-group-inline input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

.checkbox-group-inline small {
  margin-top: -0.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.8;
  text-align: center;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-subtle);
}

#filter-districts {
  max-height: 6rem;
  overflow-y: auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Hide Apartment Button
   ───────────────────────────────────────────────────────────────────────────── */
.hide-header {
  text-align: center;
  width: 5rem;
}

.action-cell {
  text-align: center;
  padding: var(--space-xs) !important;
  vertical-align: middle;
  white-space: nowrap;
}

.action-cell .btn-hide-apartment,
.action-cell .btn-global-hide {
  vertical-align: middle;
}

.btn-hide-apartment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-subtle);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-muted);
  transition: all var(--duration-fast) var(--ease-elegant);
}

.btn-hide-apartment:hover {
  border-color: var(--color-bronze);
  color: var(--color-bronze);
  background: rgba(184, 134, 11, 0.08);
}

.btn-hide-apartment.is-hidden {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(58, 107, 58, 0.08);
}

.btn-hide-apartment.is-hidden:hover {
  background: rgba(58, 107, 58, 0.15);
}

.btn-hide-apartment:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

.btn-hide-apartment:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-hide-apartment svg {
  width: 14px;
  height: 14px;
}

/* Global Hide Button */
.btn-global-hide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-subtle);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-muted);
  transition: all var(--duration-fast) var(--ease-elegant);
  margin-left: var(--space-xs);
}

.btn-global-hide:hover {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(139, 58, 58, 0.08);
}

.btn-global-hide.is-hidden {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(139, 58, 58, 0.15);
}

.btn-global-hide.is-hidden:hover {
  background: rgba(139, 58, 58, 0.25);
}

.btn-global-hide:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

.btn-global-hide svg {
  width: 14px;
  height: 14px;
}

/* Hidden rows styling */
tr.row-hidden {
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.02);
}

tr.row-hidden:hover {
  opacity: 0.7;
}

/* Globally hidden rows styling */
tr.row-globally-hidden {
  opacity: 0.4;
  background: rgba(139, 58, 58, 0.05);
  border-left: 3px solid var(--color-error);
}

tr.row-globally-hidden:hover {
  opacity: 0.6;
}

/* Toggle hidden button active state */
#toggle-hidden-btn.active {
  background: var(--color-navy);
  color: var(--color-base);
  border-color: var(--color-navy);
}

/* ─────────────────────────────────────────────────────────────────────────────
   AI Feedback Button & Modal
   ───────────────────────────────────────────────────────────────────────────── */
.ai-header {
  text-align: center;
  width: 3rem;
}

.ai-cell {
  text-align: center;
  padding: var(--space-xs) !important;
}

.btn-ai-feedback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-subtle);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-muted);
  transition: all var(--duration-fast) var(--ease-elegant);
}

.btn-ai-feedback:hover {
  border-color: var(--color-bronze);
  color: var(--color-bronze);
  background: rgba(184, 134, 11, 0.08);
}

.btn-ai-feedback:focus-visible {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
}

.btn-ai-feedback svg {
  width: 14px;
  height: 14px;
}

/* AI Button States */
.btn-ai-feedback {
  position: relative;
}

.btn-ai-feedback.loading {
  pointer-events: none;
}

.btn-ai-feedback.loading svg {
  animation: spin 1s linear infinite;
  color: var(--color-bronze);
}

.btn-ai-feedback.ready {
  border-color: var(--color-success);
  color: var(--color-success);
}

.btn-ai-feedback.ready:hover {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(34, 139, 34, 0.08);
}

.btn-ai-feedback.error {
  border-color: var(--color-error);
  color: var(--color-error);
}

.btn-ai-feedback .ai-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
}

.btn-ai-feedback.ready .ai-badge {
  background: var(--color-success);
}

.btn-ai-feedback.error .ai-badge {
  background: var(--color-error);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-base);
  max-width: 36rem;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-subtle);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-navy);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--duration-fast) var(--ease-elegant);
}

.modal-close:hover {
  color: var(--color-primary);
}

.modal-body {
  padding: var(--space-lg);
}

/* AI Loading */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
}

.ai-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--color-subtle);
  border-top-color: var(--color-bronze);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-loading p {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* AI Content */
.ai-address {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-subtle);
}

.ai-address strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--color-navy);
}

.ai-address-details {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.ai-section {
  margin-bottom: var(--space-md);
}

.ai-section h4 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-section p {
  color: var(--color-primary);
  line-height: 1.6;
}

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

.ai-list li {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-xs);
  line-height: 1.5;
}

.ai-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.ai-concerns-list li::before {
  background: var(--color-bronze);
}

.ai-recommendations-list li::before {
  background: var(--color-success);
}

.ai-error {
  padding: var(--space-md);
  background: rgba(139, 58, 58, 0.1);
  color: var(--color-error);
  text-align: center;
  font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Error Section
   ───────────────────────────────────────────────────────────────────────────── */
.error-section {
  background: rgba(139, 58, 58, 0.05);
  padding: var(--space-xl);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.error-content {
  text-align: center;
}

.error-content h2 {
  color: var(--color-error);
}

.error-content h2::after {
  background: var(--color-error);
  margin: var(--space-sm) auto 0;
}

#error-message {
  margin: var(--space-md) 0 var(--space-lg);
  color: var(--color-error);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: var(--space-md) 0;
  margin-top: var(--space-lg);
}

footer p {
  font-size: 0.8125rem;
  color: var(--color-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive - Graceful Adaptation
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
  }

  .container {
    padding: var(--space-sm);
  }

  header {
    padding: var(--space-sm) 0 var(--space-md);
  }

  .header-image {
    width: 7rem;
  }

  .subtitle {
    font-size: 0.9375rem;
  }

  .destination-row {
    flex-wrap: wrap;
  }

  .destination-row .dest-name {
    flex: 1 1 100%;
  }

  .destination-row .dest-address {
    flex: 1;
  }

  .saved-address-btn .saved-addr {
    max-width: 8rem;
  }

  .results-header {
    flex-direction: column;
    align-items: center;
  }

  .header-controls {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-group input[type="number"] {
    max-width: 100%;
  }

  th, td {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
  }

  .address-cell {
    max-width: 12rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive - Small Phones
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --space-md: 1rem;
    --space-lg: 1.25rem;
  }

  .container {
    padding: var(--space-xs);
  }

  .header-image {
    width: 6rem;
  }

  .subtitle {
    font-size: 0.8125rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  /* Form sections */
  .form-section,
  .retrieve-section,
  .single-apartment-section {
    padding: var(--space-sm);
  }

  .form-group input[type="url"],
  .form-group input[type="text"],
  .form-group input[type="number"] {
    max-width: 100%;
  }

  /* Destination rows stack fully */
  .destination-row {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .destination-row .dest-name,
  .destination-row .dest-address {
    max-width: 100%;
    width: 100%;
  }

  .destination-row .btn-remove,
  .destination-row .btn-save-address {
    align-self: flex-end;
  }

  /* Saved addresses */
  .saved-addresses-list {
    flex-direction: column;
  }

  .saved-address-item {
    width: 100%;
  }

  .saved-address-btn .saved-addr {
    max-width: none;
  }

  /* Filter panel */
  .filter-panel {
    padding: var(--space-sm);
  }

  .range-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .range-separator {
    text-align: center;
    padding: 0.25rem 0;
  }

  .filter-group input[type="number"] {
    max-width: 100%;
    width: 100%;
  }

  /* Table cells */
  th, td {
    padding: var(--space-xs);
    font-size: 0.75rem;
  }

  .address-cell {
    max-width: 10rem;
  }

  .apartment-thumbnail {
    width: 80px;
    height: 50px;
  }

  /* Action buttons - keep side by side but smaller */
  .action-cell {
    white-space: normal;
  }

  /* Modal adjustments */
  .modal-content {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem;
  }

  .modal-header {
    padding: var(--space-sm);
  }

  .modal-body {
    padding: var(--space-sm);
  }

  /* Share section */
  .share-content {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .share-section code {
    font-size: 1rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Print Styles
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
  body {
    background: white;
    color: black;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-icon,
  .btn-remove,
  .form-section,
  .progress-section,
  .sort-controls,
  .filter-panel,
  #toggle-filters,
  #toggle-hidden-btn,
  .header-image,
  .action-cell,
  .hide-header,
  .ai-cell,
  .ai-header,
  .btn-global-hide {
    display: none !important;
  }

  table {
    font-size: 10pt;
  }

  a {
    color: black;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
  }
}
