@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("./vendor/dm-sans-variable.woff2") format("woff2");
}

:root {
  --ink: #17191d;
  --muted: #66707d;
  --line: #dfe4e9;
  --line-strong: #c7cfd8;
  --soft: #f1f5f8;
  --card: #ffffff;
  --accent: #1769e0;
  --accent-soft: #edf4ff;
  --success: #18a85b;
  --warning: #d98700;
  --danger: #c43f43;
  --shadow: 0 24px 70px rgba(27, 35, 46, .08);
  --font: "DM Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #fff;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input { font: inherit; }

button { color: inherit; }

button,
input,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 2px;
}

.is-hidden { display: none !important; }

.shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--card);
  box-shadow: 0 0 0 1px rgba(27, 35, 46, .04), var(--shadow);
}

.screen-state {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.screen-state h1 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -.035em;
}

.screen-state p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
}

.state-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #dce4ed;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

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

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 11px;
  padding: 11px 16px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled {
  opacity: .55;
  cursor: wait;
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.screen-state .secondary-button { margin-top: 12px; }

.text-button {
  min-width: 44px;
  min-height: 36px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Login */

.login-view {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: max(34px, env(safe-area-inset-top)) 24px max(34px, env(safe-area-inset-bottom));
  background: #fff;
}

.login-mark {
  position: absolute;
  top: max(22px, calc(env(safe-area-inset-top) + 16px));
  left: 24px;
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
}

.login-panel {
  width: min(100%, 520px);
  margin: 0 auto;
}

.login-brand {
  width: min(100%, 340px);
  margin: 0 auto 74px;
}

.login-panel h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .34em;
  margin: 0;
  justify-content: flex-start;
  text-align: left;
  font-size: clamp(24px, 6.2vw, 32px);
  line-height: 1.08;
  letter-spacing: 2px;
  font-weight: 400;
}

.title-light {
  color: #6f747d;
  font-weight: 330;
}

.title-strong {
  color: var(--ink);
  font-weight: 780;
}

.login-form { display: grid; gap: 9px; }

.login-form label {
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  appearance: none;
}

.login-form input[readonly] {
  color: #303640;
  background: #f8fafb;
}

.login-form input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 14%, transparent);
}

.password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.login-form .primary-button { margin-top: 12px; }

.form-message {
  margin: 5px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #932c31;
  background: #fff1f2;
  font-size: 13px;
}

.privacy-note {
  margin: 26px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* Catalog */

.catalog-view {
  min-height: 100svh;
  background: #fff;
}

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(18px);
}

.brand-row,
.brand-lockup,
.catalog-summary,
.account-control { display: flex; align-items: center; }

.brand-row {
  min-height: 48px;
  justify-content: space-between;
  gap: 14px;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-lockup img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-lockup h1 {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: .32em;
  margin: 0;
  overflow: hidden;
  font-size: clamp(17px, 4.3vw, 25px);
  line-height: 1.1;
  letter-spacing: 2px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-control { position: relative; flex: 0 0 auto; }

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:active { background: var(--soft); }

.icon-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #4f5968;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-menu {
  position: absolute;
  top: 49px;
  right: 0;
  width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(23, 25, 29, .16);
}

.account-menu span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-menu .secondary-button { margin-top: 9px; }

.catalog-summary {
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.catalog-summary strong { font-size: 14px; }

.sync-status {
  color: #277448;
  font-size: 12px;
}

.sync-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
}

.sync-status.is-offline { color: #7f5700; }
.sync-status.is-offline::before { background: var(--warning); }

.search-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent);
}

.search-field svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  appearance: none;
}

.search-field input::placeholder { color: #8a94a1; }

.filter-row {
  display: flex;
  gap: 7px;
  margin: 10px -18px 0;
  padding: 0 18px 3px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #4e5865;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.search-scope {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.offline-banner {
  margin: 9px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #7f5700;
  background: #fff7df;
  font-size: 12px;
}

.catalog-content { min-height: 420px; }

.catalog-loading {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.catalog-list { padding: 0 18px max(28px, env(safe-area-inset-bottom)); }

.category-group { margin: 0; }

.category-heading {
  position: sticky;
  top: 218px;
  z-index: 5;
  margin: 0 -18px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  color: #66707d;
  background: rgba(247, 249, 251, .96);
  backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.equipment-row {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.equipment-row:active { background: #f8fafb; }

.equipment-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fbfcfd;
}

.equipment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.equipment-copy { min-width: 0; }

.equipment-copy strong,
.equipment-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-copy strong {
  font-size: 15px;
  letter-spacing: -.012em;
}

.equipment-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.equipment-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: #515b68;
  font-size: 11px;
}

.equipment-meta .category {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.is-pending { background: var(--warning); }

.row-chevron {
  width: 9px;
  height: 9px;
  border-top: 1.8px solid #55606d;
  border-right: 1.8px solid #55606d;
  transform: rotate(45deg);
}

.empty-state {
  padding: 62px 24px;
  text-align: center;
}

.empty-state h2 { margin: 0; font-size: 19px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); }

/* Equipment detail, public or authenticated */

.equipment-view { min-height: 100svh; background: #fff; }

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: calc(48px + env(safe-area-inset-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 18px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
}

.back-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 1px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.back-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-security {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.hero {
  padding: 12px 22px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.art {
  width: 100%;
  height: clamp(215px, 38svh, 360px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.art-empty { color: var(--muted); font-size: 13px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 12px;
}

.chip {
  padding: 5px 9px;
  border-radius: 999px;
  color: #4e5865;
  background: #edf1f4;
  font-size: 12px;
  font-weight: 650;
}

.chip.status { color: #16753c; background: #e9f8ef; }
.chip.status.is-pending { color: #855700; background: #fff4d5; }

.hero h1 {
  margin: 0;
  font-size: clamp(29px, 8vw, 42px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.model { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.model:empty { display: none; }

.content { padding: 2px 22px calc(36px + env(safe-area-inset-bottom)); }

.section { padding: 23px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: -.015em; }
.section p { margin: 0; color: #414a56; white-space: pre-line; }
.section dl { margin: 0; }

.info-row {
  display: grid;
  grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f2;
}

.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; font-weight: 560; overflow-wrap: anywhere; }

.source-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
  text-decoration: none;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  color: #7b838e;
  text-align: center;
  font-size: 12px;
}

.footer img { width: 24px; height: 24px; object-fit: contain; }

@media (min-width: 680px) {
  body { padding: 28px; }
  .shell { min-height: calc(100svh - 56px); border-radius: 28px; overflow: hidden; }
  .login-view,
  .screen-state,
  .catalog-view,
  .equipment-view { min-height: calc(100svh - 56px); }
  .catalog-header { padding-left: 30px; padding-right: 30px; }
  .filter-row { margin-left: -30px; margin-right: -30px; padding-left: 30px; padding-right: 30px; }
  .catalog-list { padding-left: 30px; padding-right: 30px; }
  .category-heading { margin-left: -30px; margin-right: -30px; padding-left: 30px; padding-right: 30px; }
  .hero { padding: 20px 38px 28px; }
  .content { padding-left: 38px; padding-right: 38px; }
  .art { height: 390px; }
}

@media (max-width: 430px) {
  .brand-lockup { gap: 8px; }
  .brand-lockup img { width: 36px; height: 36px; }
  .brand-lockup h1 { font-size: 15.5px; letter-spacing: 1.4px; }
  .equipment-row { grid-template-columns: 56px minmax(0, 1fr) auto 16px; gap: 10px; min-height: 78px; }
  .equipment-thumb { width: 56px; height: 56px; }
  .equipment-meta .category { max-width: 80px; }
}

@media (max-width: 355px) {
  .catalog-header,
  .catalog-list { padding-left: 14px; padding-right: 14px; }
  .filter-row { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .category-heading { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .brand-lockup h1 { font-size: 14.5px; letter-spacing: 1.2px; }
  .equipment-row { grid-template-columns: 52px minmax(0, 1fr) 8px 14px; }
  .equipment-thumb { width: 52px; height: 52px; }
  .equipment-meta .category { display: none; }
  .hero,
  .content { padding-left: 17px; padding-right: 17px; }
  .art { height: 210px; }
  .info-row { grid-template-columns: 1fr; gap: 3px; }
  .info-row dd { font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.5s; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
