@font-face { font-family: "Ubuntu"; src: url("/static/assets/ubuntu-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("/static/assets/ubuntu-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("/static/assets/ubuntu-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f5f8ff;
  --surface: #e9eefa;
  --surface-strong: #dfe6f5;
  --text: #1c222d;
  --brand: #3e495e;
  --muted: #71809e;
  --accent: #fab835;
  --accent-soft: #fff1c9;
  --danger: #d64858;
  --line: rgba(62, 73, 94, .13);
  --white: #ffffff;
  font-family: "Ubuntu", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 0 22px 118px; }
.site-header { display: flex; align-items: center; min-height: 68px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 108px; height: auto; display: block; }
.intro { padding: 34px 0 24px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; }
h1 { margin: 7px 0 0; font-size: clamp(34px, 7vw, 58px); line-height: 1; letter-spacing: -.045em; }
.intro p { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.model-section { display: flex; align-items: flex-start; gap: 10px; }
.section-label { flex: 0 0 auto; padding-top: 11px; font-size: 13px; font-weight: 700; color: var(--brand); }
.model-chips { display: flex; align-items: center; flex: 1 1 auto; flex-wrap: wrap; gap: 8px; padding-bottom: 1px; }
.model-chip, .add-model-chip { flex: 0 0 auto; min-height: 38px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.model-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 5px 4px 13px; background: var(--accent); color: var(--text); }
.model-chip button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(28, 34, 45, .1); }
.model-chip button img { width: 14px; height: 14px; opacity: .7; }
.add-model-chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid rgba(62,73,94,.14); background: var(--white); color: var(--brand); }
.add-model-chip img { width: 15px; height: 15px; opacity: .7; }

.catalog-controls { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 22px 2px 14px; }
.sort-control { min-width: 190px; }
select, input { min-width: 0; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: var(--white); color: var(--text); padding: 11px 12px; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(250,184,53,.18); }
.results-count { color: var(--muted); font-size: 13px; padding-bottom: 11px; white-space: nowrap; }

.catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.boat-card { min-width: 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 20px; transition: transform .18s ease, border-color .18s ease; }
.boat-card:hover { transform: translateY(-2px); border-color: rgba(250,184,53,.65); }
.card-click { cursor: pointer; }
.card-image { position: relative; overflow: hidden; aspect-ratio: 4/3; background: var(--surface); }
.card-image > img:not(.placeholder-icon) { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-placeholder, .image-fallback { width: 100%; height: 100%; place-items: center; background: var(--surface); }
.image-placeholder { display: grid; }
.image-fallback { display: none; position: absolute; inset: 0; }
.image-failed .image-fallback { display: grid; }
.placeholder-icon { width: 42px; height: 42px; opacity: .22; }
.badge { position: absolute; top: 10px; left: 10px; padding: 6px 9px; border-radius: 999px; background: var(--accent); color: var(--text); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.favorite-button { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(28,34,45,.68); backdrop-filter: blur(8px); }
.heart-icon { width: 20px; height: 20px; filter: invert(1); }
.favorite-button.active { background: var(--white); }
.favorite-button.active .heart-icon, .favorite-wide.active .heart-icon { filter: invert(34%) sepia(47%) saturate(1783%) hue-rotate(314deg) brightness(92%); }
.card-body { padding: 14px; }
.card-source { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .1em; font-weight: 700; }
.card-title { margin: 6px 0 10px; min-height: 40px; font-size: 16px; line-height: 1.25; }
.card-facts { display: grid; gap: 5px; margin: 0 0 12px; padding: 9px; border-radius: 10px; background: var(--surface); }
.card-fact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: start; font-size: 11px; line-height: 1.25; }
.card-fact dt { min-width: 0; color: var(--muted); }
.card-fact dd { max-width: 120px; margin: 0; color: var(--text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.card-price { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

.skeleton { min-height: 330px; border-radius: 20px; background: linear-gradient(100deg, var(--surface) 30%, #f1f4fb 50%, var(--surface) 70%); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
.empty { grid-column: 1/-1; padding: 64px 20px; border: 1px dashed rgba(62,73,94,.2); border-radius: 20px; color: var(--muted); text-align: center; line-height: 1.45; }
.empty strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 18px; }
.load-more, .primary-button { display: block; padding: 13px 18px; border: 0; border-radius: 14px; background: var(--accent); color: var(--text); font-weight: 700; }
.load-more { min-width: 180px; margin: 24px auto 0; }
.hidden { display: none !important; }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr; width: min(520px, 100%); min-height: 72px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.nav-button { display: grid; justify-items: center; align-content: center; gap: 4px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; }
.nav-icon { display: grid; place-items: center; width: 34px; height: 28px; border-radius: 999px; }
.nav-icon img { width: 21px; height: 21px; opacity: .58; }
.nav-button.active { color: var(--text); font-weight: 700; }
.nav-button.active .nav-icon { background: var(--accent); }
.nav-button.active .nav-icon img { opacity: .82; }

dialog { color: var(--text); }
.sheet { width: min(760px, calc(100% - 24px)); max-height: 92vh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 26px; background: var(--bg); box-shadow: 0 28px 80px rgba(28,34,45,.25); }
.sheet::backdrop { background: rgba(28,34,45,.5); backdrop-filter: blur(5px); }
.sheet-handle { display: none; width: 42px; height: 4px; margin: 9px auto; border-radius: 99px; background: #aab4c8; }
.close-button { position: sticky; z-index: 4; top: 14px; float: right; display: grid; place-items: center; width: 42px; height: 42px; margin: 14px 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.9); }
.close-button img { width: 18px; height: 18px; opacity: .7; }
.detail-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--surface); }
.detail-gallery img, .detail-gallery .image-placeholder { flex: 0 0 100%; width: 100%; aspect-ratio: 16/10; object-fit: cover; scroll-snap-align: start; }
.detail-body { padding: 22px; }
.detail-title { margin: 6px 48px 10px 0; font-size: 27px; line-height: 1.13; }
.detail-price { color: var(--text); font-size: 30px; font-weight: 700; }
.detail-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 20px 0; }
.source-button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--accent); color: var(--text); font-weight: 700; text-align: center; text-decoration: none; }
.source-button img { width: 18px; height: 18px; }
.favorite-wide { display: grid; place-items: center; min-width: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.favorite-wide .heart-icon { filter: none; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 16px 0 24px; }
.spec { padding: 12px; border-radius: 12px; background: var(--surface); }
.spec span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.spec strong { font-size: 13px; }
.description { color: var(--brand); line-height: 1.55; white-space: pre-wrap; }
.price-chart { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--surface); }
.price-chart h3 { margin: 0 0 12px; font-size: 15px; }
.price-chart svg { width: 100%; height: 130px; overflow: visible; }
.muted-text { color: var(--muted); font-size: 12px; }
.detail-skeleton { margin: 60px 20px; }

.filters-sheet { padding: 0 22px 28px; }
.sheet-title { padding-top: 22px; }
.sheet-title h2 { margin: 5px 0 6px; font-size: 28px; }
.sheet-title p { margin: 0 52px 20px 0; color: var(--muted); line-height: 1.4; }
.managed-filters { display: grid; gap: 9px; }
.managed-filter { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.managed-filter-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.managed-filter strong { display: block; }
.managed-filter small { color: var(--muted); }
.delete-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border: 0; border-radius: 10px; background: rgba(214,72,88,.08); color: var(--danger); }
.delete-button img { width: 15px; height: 15px; filter: invert(34%) sepia(47%) saturate(1783%) hue-rotate(314deg) brightness(92%); }
.price-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.price-presets button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; }
.price-presets button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.add-filter-form { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.add-filter-form h3 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { color: var(--muted); font-size: 11px; }
.form-grid input { display: block; width: 100%; margin-top: 5px; }
.primary-button { width: 100%; margin-top: 12px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 88px; transform: translate(-50%, 18px); max-width: calc(100% - 28px); padding: 11px 16px; border-radius: 999px; background: var(--text); color: var(--white); opacity: 0; pointer-events: none; font-size: 13px; font-weight: 500; text-align: center; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) { .catalog { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) {
  .app-shell { padding: 0 13px 106px; }
  .site-header { min-height: 58px; }
  .brand-logo { width: 96px; }
  .intro { padding: 26px 2px 20px; }
  .intro p { max-width: 330px; }
  .model-section { margin: 0 2px; }
  .catalog-controls { margin-top: 18px; }
  .sort-control { min-width: 176px; }
  .catalog { grid-template-columns: 1fr 1fr; gap: 9px; }
  .boat-card { border-radius: 16px; }
  .card-body { padding: 11px; }
  .card-title { min-height: 34px; font-size: 13px; }
  .card-price { font-size: 16px; }
  .card-facts { gap: 4px; margin-bottom: 9px; padding: 7px; }
  .card-fact { grid-template-columns: 1fr; gap: 1px; font-size: 9px; }
  .card-fact dd { max-width: none; text-align: left; }
  .favorite-button { width: 34px; height: 34px; }
  .heart-icon { width: 18px; height: 18px; }
  .sheet { width: 100%; max-height: 94vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet-handle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  h1 { font-size: 32px; }
  .catalog-controls { align-items: start; flex-direction: column; gap: 8px; }
  .sort-control { width: 100%; }
  .results-count { padding: 0 2px; }
}
