/* B + E: presentation tokens stay inside the homepage, away from dialogs. */
#application.hose-home {
  --home-ink: #1c2429;
  --home-paper: #fffefb;
  --home-canvas: #f0efe9;
  --home-line: #c7cece;
  --home-muted: #58666d;
  --home-blue: #174475;
  --home-blue-deep: #102f51;
  --home-blue-wash: #edf2f7;
  --home-orange: #ef8149;
  --home-orange-wash: #ffecdf;
  --home-focus: #174475;
  --home-navigation-width: 180px;
  display: grid;
  grid-template-columns: var(--home-navigation-width) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100dvh - 60px);
  background: var(--home-canvas);
}
body.hose-home-active { min-width: 0; background: #f0efe9; }
.product-card__blueprint-heading, .product-card__open { display: none; }

.hose-home > .app-header {
  grid-column: 1 / -1;
  width: 100%;
  border-bottom: 2px solid var(--home-ink);
  background: var(--home-paper);
  backdrop-filter: none;
  color: var(--home-ink);
}
.hose-home .app-header__inner {
  width: 100%;
  min-height: 80px;
  padding: 12px 28px;
  gap: 24px;
}
.hose-home .brand-block { min-width: 0; gap: 12px; }
.hose-home .brand-block h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; }
.hose-home .brand-mark { width: 44px; height: 44px; border-radius: 3px; background: transparent; box-shadow: none; }
.hose-home .brand-mark svg { display: none; }
.hose-home .homepage-brand-icon { display: block; width: 44px; height: 44px; }
.hose-home .header-actions { min-width: 0; gap: 16px; }
.hose-home .offline-badge { font-size: .75rem; color: var(--home-muted); }
.hose-home .user-chip { min-width: 0; max-width: 180px; border-color: var(--home-line); overflow-wrap: anywhere; }
.hose-home .user-chip strong { color: var(--home-ink); font-size: .875rem; }
.hose-home .user-chip small { color: var(--home-muted); font-size: .75rem; }
.hose-home #logout-button { width: 44px; height: 44px; border-radius: 2px; color: var(--home-ink); background: var(--home-paper); border-color: var(--home-line); flex-shrink: 0; }

.hose-home .homepage-navigation {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--home-paper);
  background: var(--home-ink);
}
.hose-home .homepage-navigation-toggle {
  flex-shrink: 0;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #52616b;
  border-radius: 2px;
  color: var(--home-paper);
  background: transparent;
  font-size: .75rem;
}
.hose-home .homepage-navigation-toggle svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.hose-home .homepage-navigation__content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: auto;
  /* Reserve the 3px focus outline and its 3px offset inside the scroll area. */
  padding: 6px;
  margin: -6px;
}
.hose-home .homepage-navigation__content > :not(.homepage-navigation__signature) {
  flex-shrink: 0;
}
.hose-home .homepage-catalog-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px;
  border-left: 3px solid var(--home-orange);
  background: #333e45;
  color: var(--home-paper);
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
}
.hose-home .homepage-catalog-link span { font-family: Consolas, monospace; color: var(--home-orange); font-size: .75rem; }
.hose-home .homepage-management > summary { padding: 0 12px 12px; color: #b4c0c7; font-size: .75rem; letter-spacing: .08em; list-style: none; }
.hose-home .homepage-management > summary::-webkit-details-marker { display: none; }
.hose-home .homepage-management > summary span { display: none; }
.hose-home .homepage-management__actions { display: grid; gap: 8px; }
.hose-home .homepage-management__actions .button {
  justify-content: flex-start;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #e4e9ec;
  background: transparent;
  font-size: .875rem;
  font-weight: 500;
}
.hose-home .homepage-navigation__signature { margin-top: auto; padding: 24px 12px 0; display: grid; gap: 8px; color: #b4c0c7; font-size: .75rem; }
.hose-home .homepage-navigation__signature strong { font: 800 1.75rem Consolas, monospace; color: var(--home-orange); }

.hose-home > .app-main {
  width: 100%;
  min-width: 0;
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 32px 48px;
  color: var(--home-ink);
}
.hose-home .catalog-shell { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.hose-home .unified-search-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0 0 24px; border-bottom: 3px solid var(--home-ink); gap: 20px; align-items: flex-end; }
.hose-home .homepage-kicker { margin: 0 0 8px; color: var(--home-muted); font-size: .75rem; font-weight: 650; letter-spacing: .12em; }
.hose-home .unified-search-heading h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); color: var(--home-ink); font-weight: 850; line-height: 1.25; }
.hose-home #metrics { grid-column: 2; justify-self: end; align-self: end; min-width: 0; width: fit-content; max-width: 100%; display: flex; gap: 24px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.hose-home #metrics > div { display: flex; align-items: baseline; gap: 8px; padding: 0; background: transparent; }
.hose-home #metrics dt { font-size: .75rem; color: var(--home-muted); }
.hose-home #metrics dd { margin: 0; font-size: 1rem; color: var(--home-ink); font-family: Consolas, monospace; }
.hose-home #catalog-results { scroll-margin-top: 104px; }
.hose-home #homepage-search-create-action { display: flex; min-width: 0; }
.hose-home #homepage-search-create-action .button { width: 100%; }

.hose-home :is(.app-header, .homepage-navigation, .app-main) :is(button, summary, a, input, select, [role="button"]):focus-visible {
  outline: 3px solid var(--home-focus);
  outline-offset: 3px;
}
#application.hose-home .homepage-navigation :is(button, summary, a):focus-visible { outline-color: var(--home-orange); }
.hose-home .app-main .button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 2px;
  border-color: #9aa7ae;
  color: var(--home-ink);
  background: var(--home-paper);
  font-size: .875rem;
  box-shadow: none;
}
.hose-home .app-main :is(.button, .product-card__open, .product-card__qr, .product-card__title, .search-image-menu summary),
.hose-home .app-header .icon-button,
.hose-home .homepage-navigation :is(.button, a, summary) {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.hose-home .app-main #new-product-button { background: var(--home-orange); border-color: var(--home-orange); color: var(--home-ink); font-weight: 750; }
.hose-home .app-main #search-submit-button { color: var(--home-paper); border-color: var(--home-ink); background: var(--home-ink); }
.hose-home .app-main :is(.button--secondary, .button--photo) { color: var(--home-blue-deep); border-color: #aabccb; background: var(--home-blue-wash); }
.hose-home .search-panel { padding: 24px 0 0; border-radius: 0; background: transparent; }
.hose-home .search-tools { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.hose-home .search-box { min-width: 0; height: 52px; padding: 0 12px; border-radius: 2px; border-color: #9aa7ae; background: var(--home-paper); box-shadow: none; }
.hose-home .search-box:focus-within { border-color: var(--home-blue); box-shadow: 0 0 0 3px #17447526; }
.hose-home .search-box > input { min-width: 0; color: var(--home-ink); font-size: 1rem; }
.hose-home .search-box > svg { color: var(--home-muted); stroke: currentColor; width: 20px; height: 20px; }
.hose-home .search-image-menu summary { min-height: 44px; padding: 8px 12px; border-radius: 2px; color: var(--home-blue-deep); border-color: #aabccb; background: var(--home-blue-wash); font-size: .75rem; }
.hose-home .search-image-menu > div { width: 256px; border-radius: 3px; border-color: var(--home-line); background: var(--home-paper); }
.hose-home .search-image-menu label { min-height: 52px; border-radius: 2px; background: var(--home-blue-wash); }
.hose-home .search-image-menu label span { color: var(--home-blue-deep); font-size: .875rem; }
.hose-home .search-image-menu label small { color: var(--home-muted); font-size: .75rem; }
.hose-home .photo-search-actions { gap: 8px; }
.hose-home .photo-search-actions .button { min-width: 0; }
.hose-home .homepage-filters { margin-top: 16px; border: 1px solid var(--home-line); background: var(--home-paper); }
.hose-home .homepage-filters > summary { min-height: 44px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; font-size: .875rem; font-weight: 650; }
.hose-home .homepage-filters > summary::-webkit-details-marker { display: none; }
.hose-home #homepage-filter-summary { min-width: 0; flex: 1; color: var(--home-muted); font-size: .75rem; font-weight: 400; overflow-wrap: anywhere; }
.hose-home .homepage-filter-count { min-width: 24px; padding: 2px 6px; color: var(--home-blue-deep); background: var(--home-blue-wash); text-align: center; font-size: .75rem; }
.hose-home .homepage-filters[open] .homepage-filter-indicator { font-size: 0; }
.hose-home .homepage-filters[open] .homepage-filter-indicator::after { content: "−"; font-size: .875rem; }
.hose-home #homepage-filter-fields { border-top: 1px solid var(--home-line); padding: 16px; }
.hose-home .filter-row { margin: 0; grid-template-columns: 1.15fr .82fr 1fr .9fr auto; gap: 12px; }
.hose-home .filter-row label > span { color: var(--home-muted); font-size: .75rem; margin: 0 0 8px; }
.hose-home .filter-row select { min-height: 44px; border-radius: 2px; border-color: #9aa7ae; color: var(--home-ink); background: var(--home-paper); font-size: .875rem; }
.hose-home .image-search-notice { color: var(--home-blue-deep); border-color: #aabccb; border-radius: 2px; background: var(--home-blue-wash); }
.hose-home .admin-review-notice { margin-top: 16px; border-radius: 2px; border-color: #dcc4b6; background: #fff9f3; }
.hose-home .results-toolbar { min-height: 64px; border-bottom: 1px solid var(--home-line); margin-bottom: 16px; }
.hose-home .results-toolbar p { color: var(--home-muted); overflow-wrap: anywhere; }
.hose-home .results-toolbar strong { color: var(--home-ink); font-size: 1rem; }

.hose-home .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hose-home .product-card--hose { position: relative; border-radius: 3px; border-color: var(--home-line); background: var(--home-paper); color: var(--home-ink); }
.hose-home .product-card--hose:hover { transform: none; box-shadow: none; border-color: var(--home-blue); }
.hose-home .product-card__blueprint-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; padding: 10px 16px; color: #edf3f9; background: var(--home-blue); font-size: .75rem; }
.hose-home .product-card__blueprint-heading span:last-child { font: .625rem Consolas, monospace; letter-spacing: .08em; color: #c8d9eb; }
.hose-home .product-card__image-shell { border: 8px solid var(--home-blue); border-top: 0; border-bottom-width: 6px; background: #fff; }
.hose-home .product-card__image img { background: #fff; filter: none; mix-blend-mode: normal; }
.hose-home .product-card__image { position: relative; }
.hose-home .product-card__image:focus-visible { outline: 3px solid var(--home-focus); outline-offset: -5px; }
.hose-home .product-card__image:focus-visible::after { content: ""; position: absolute; inset: 2px; border: 2px solid #fff; box-shadow: inset 0 0 0 3px var(--home-focus); pointer-events: none; z-index: 5; }
.hose-home .product-card__material { border-radius: 2px; box-shadow: none; bottom: 8px; right: 8px; max-width: calc(100% - 16px); }
.hose-home .image-placeholder { background: var(--home-blue-wash); color: var(--home-blue); }
.hose-home .placeholder-hose { stroke: #597ea4; }
.hose-home .product-card__body { padding: 16px; gap: 12px; }
.hose-home .product-card__head { align-items: center; }
.hose-home .product-card__meta--hose > span:first-child { color: var(--home-muted); font-size: .875rem; font-weight: 600; }
.hose-home .product-card__qr { min-width: 64px; min-height: 64px; padding: 4px; border: 1px solid var(--home-line); border-radius: 2px; background: #fff; }
.hose-home .product-card__qr img { width: 54px; height: 54px; background: #fff; }
.hose-home .product-card__identity { font-size: .75rem; gap: 8px; }
.hose-home .product-card__identity dt, .hose-home .product-card__field-label { color: var(--home-muted); }
.hose-home .product-card__identity dd { color: var(--home-ink); font-weight: 650; }
.hose-home .product-card__stage { border: 1px solid #c1cbd0; border-radius: 2px; font-size: .75rem; padding: 4px 8px; }
.hose-home .product-card__stage--quote { color: #704b13; background: #faf3e2; border-color: #cfba91; }
.hose-home .product-card__stage--sample { color: #28486d; background: #edf2fa; border-color: #b6c7df; }
.hose-home .product-card__stage--small_batch { color: #864212; background: var(--home-orange-wash); border-color: #dbb598; }
.hose-home .product-card__stage--mass_production { color: #245848; background: #eef5f0; border-color: #b2c4be; }
.hose-home .product-card__title { padding: 12px 0 0; margin: 0; gap: 8px; border-top: 1px solid var(--home-line); grid-template-columns: 56px minmax(0, 1fr); }
.hose-home .product-card__title h2 { font-size: 1.125rem; line-height: 1.45; }
.hose-home .product-card__model { font: 650 .875rem/1.5 Consolas, "Microsoft YaHei", monospace; }
.hose-home .product-card--hose :is(.product-card__model, h2, .product-card__meta--hose > span:first-child, .product-card__identity dd) { display: block; overflow: visible; -webkit-line-clamp: unset; white-space: normal; overflow-wrap: anywhere; }
.hose-home .product-card__related-slot { min-height: 0; }
.hose-home .product-card__related { padding-top: 8px; border-top: 1px solid var(--home-line); }
.hose-home .match-reasons { margin-top: 0; }
.hose-home .match-reasons span { color: var(--home-blue-deep); background: var(--home-blue-wash); border-radius: 2px; white-space: normal; overflow-wrap: anywhere; }
.hose-home .product-card__open { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-top: auto; padding: 12px 16px; border: 0; border-top: 1px solid var(--home-line); background: var(--home-paper); color: var(--home-ink); font-size: .875rem; font-weight: 700; }
.hose-home .product-card__open span { color: var(--home-blue); font-size: 1.25rem; }
.hose-home .empty-state { border: 1px dashed #9aa7ae; background: var(--home-paper); }
.hose-home .empty-state > div { color: var(--home-blue); border-radius: 2px; background: var(--home-blue-wash); }
.hose-home .empty-state p { color: var(--home-muted); }
.hose-home .catalog-shell { animation: homepage-enter .36s ease-out both; }
.hose-home .homepage-management[open] .homepage-management__actions,
.hose-home .homepage-filters[open] #homepage-filter-fields { animation: homepage-disclosure .18s ease-out; }

@keyframes homepage-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes homepage-disclosure { from { opacity: .4; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) {
  .hose-home .app-main .button:not(:disabled):hover { transform: none; border-color: var(--home-blue); background: var(--home-blue-wash); }
  .hose-home .app-main #new-product-button:not(:disabled):hover { background: #f69b6c; border-color: var(--home-orange); box-shadow: 0 3px 0 #1c242920; }
  .hose-home .app-main #search-submit-button:not(:disabled):hover { color: #fff; background: var(--home-blue-deep); }
  .hose-home .product-card__open:hover { background: var(--home-orange-wash); }
  .hose-home :is(.product-card__title, .product-card__qr, #logout-button):hover { background: var(--home-blue-wash); }
  .hose-home .homepage-navigation :is(a, .button):hover { transform: none; color: #fff; background: #333e45; border-color: #52616b; }
  .hose-home .search-image-menu summary:hover { background: #dce7f2; }
  .hose-home .search-image-menu label:hover { background: #dce7f2; }
  .hose-home .homepage-filters > summary:hover { background: var(--home-blue-wash); }
  .hose-home .homepage-management > summary:hover { background: #333e45; color: #fff; }
}
.hose-home :is(.app-header, .homepage-navigation, .app-main) :is(button, summary, a):active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 2px #17447526; }
.hose-home :is(.app-main, .homepage-navigation) .button:hover { transform: none; }
.hose-home :is(.app-header, .homepage-navigation, .app-main) button:disabled { opacity: .5; transform: none; box-shadow: none; cursor: not-allowed; }

@media (max-width: 1180px) {
  .hose-home .search-tools { grid-template-columns: 1fr; }
  .hose-home .photo-search-actions .button { flex: 1; }
  .hose-home .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hose-home .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hose-home .filter-row > button { grid-column: 1 / -1; }
}
@media (min-width: 881px) {
  .hose-home .homepage-navigation {
    position: fixed;
    z-index: 20;
    top: var(--home-header-height);
    bottom: 0;
    left: 0;
    width: var(--home-navigation-width);
    overflow: hidden;
  }
  .hose-home > .app-main { grid-column: 2; }
  #application.hose-home.homepage-navigation-collapsed { --home-navigation-width: 72px; }
  .hose-home.homepage-navigation-collapsed .homepage-navigation-toggle span { display: none; }
  .hose-home.homepage-navigation-collapsed .homepage-navigation-toggle svg { transform: rotate(180deg); }
}
@media (max-width: 880px) {
  #application.hose-home { grid-template-columns: 1fr; }
  .hose-home .app-header__inner { padding: 12px 20px; gap: 16px; }
  .hose-home .offline-badge { display: none; }
  .hose-home .homepage-navigation { position: static; height: auto; min-height: 0; padding: 12px 20px; flex-direction: row; align-items: flex-start; gap: 12px; overflow: visible; }
  .hose-home .homepage-navigation__content { display: contents; }
  .hose-home .homepage-catalog-link { min-width: 132px; }
  .hose-home .homepage-management { min-width: 0; flex: 1; }
  .hose-home .homepage-management > summary { min-height: 48px; padding: 12px; display: flex; gap: 16px; align-items: center; font-size: .875rem; letter-spacing: normal; color: #fff; border: 1px solid #52616b; cursor: pointer; }
  .hose-home .homepage-management > summary span { display: block; margin-left: auto; }
  .hose-home .homepage-management[open] > summary span { font-size: 0; }
  .hose-home .homepage-management[open] > summary span::after { content: "−"; font-size: .875rem; }
  .hose-home .homepage-management__actions { padding-top: 8px; }
  .hose-home .homepage-navigation__signature { display: none; }
  .hose-home > .app-main { padding: 24px 20px 40px; }
  .hose-home .unified-search-heading { flex-direction: row; align-items: flex-end; }
  .hose-home .filter-row select { font-size: 1rem; }
}
@media (max-width: 580px) {
  .hose-home .app-header__inner { min-height: 72px; padding: 12px 16px; gap: 12px; }
  .hose-home .brand-block { gap: 8px; }
  .hose-home .brand-block h1 { font-size: 1rem; }
  .hose-home .brand-mark, .hose-home .homepage-brand-icon { width: 40px; height: 40px; }
  .hose-home .header-actions { gap: 8px; }
  .hose-home .homepage-navigation { padding: 12px 16px; gap: 12px; }
  .hose-home > .app-main { padding: 24px 16px 32px; }
  .hose-home .unified-search-heading { grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; }
  .hose-home #metrics { grid-column: 1; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; }
  .hose-home #catalog-results { scroll-margin-top: 88px; }
  .hose-home .search-panel { padding-top: 20px; }
  .hose-home .search-box { height: auto; min-height: 52px; padding: 10px 12px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
  .hose-home .search-box > input { min-height: 36px; padding: 0; }
  .hose-home .search-image-menu { grid-column: 1 / -1; justify-self: stretch; }
  .hose-home .search-image-menu summary { width: 100%; justify-content: center; }
  .hose-home .search-image-menu > div { right: 0; width: 100%; }
  .hose-home .photo-search-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hose-home .photo-search-actions #search-submit-button { grid-column: 1 / -1; }
  .hose-home .photo-search-actions .button { padding: 10px 8px; white-space: normal; }
  .hose-home .homepage-filters > summary { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .hose-home #homepage-filter-summary { order: 4; flex-basis: 100%; }
  .hose-home .homepage-filter-count { margin-left: auto; }
  .hose-home #homepage-filter-fields { padding: 12px; }
  .hose-home .filter-row { grid-template-columns: 1fr; gap: 16px; }
  .hose-home .results-toolbar { padding: 16px 0; gap: 8px; align-items: flex-start; }
  .hose-home .product-grid { grid-template-columns: 1fr; gap: 20px; }
  .hose-home .admin-review-notice { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .hose-home .admin-review-notice > div { min-width: 0; }
  .hose-home .admin-review-notice .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(body.hose-home-active) { scroll-behavior: auto; }
  .hose-home :is(.app-header, .homepage-navigation, .app-main) *,
  .hose-home :is(.app-header, .homepage-navigation, .app-main) *::before,
  .hose-home :is(.app-header, .homepage-navigation, .app-main) *::after { animation: none !important; transition: none !important; }
  .hose-home :is(.app-header, .homepage-navigation, .app-main) :is(button, summary, a):active { transform: none; }
}
