@font-face {
  font-family: "LINE Seed JP";
  src: url("/static/fonts/line-seed-jp/LINESeedJP_OTF_Bd.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #171717;
  --panel: #262626;
  --field: #171717;
  --border: #404040;
  --text: #e5e5e5;
  --muted: #a3a3a3;
  --soft: #737373;
  --accent: #7c3aed;
  --accent-light: #cfb2ff;
  --radius-panel: 14px;
  --radius-control: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #666 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #666;
  background-clip: content-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--page);
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: "LINE Seed JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.pageAuth {
  min-height: 100svh;
}

.authPage {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 32px 16px;
}

.authShell {
  width: min(100%, 420px);
  text-align: center;
}

.authBrand {
  justify-content: center;
  margin-bottom: 28px;
  font-size: 18px;
}

.authBrand img {
  width: 40px;
  height: 40px;
}

.authPanel {
  padding: 28px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
}

h1,
h2,
p {
  margin: 0;
}

.authPanel h1 {
  font-size: 25px;
  line-height: 1.2;
}

.formStack {
  display: grid;
  gap: 16px;
  margin-top: 25px;
}

.fieldLabel {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.fieldLabel input,
.dateInput,
.pickerButton {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.fieldLabel input {
  padding: 0 13px;
}

.fieldLabel input::placeholder {
  color: var(--soft);
}

.fieldLabel input:focus,
.dateInput:focus,
.pickerButton:focus-visible,
.quietButton:focus-visible,
.primaryButton:focus-visible {
  border-color: var(--accent-light);
  outline: 2px solid rgba(207, 178, 255, 0.22);
  outline-offset: 1px;
}

.primaryButton,
.quietButton,
.pickerButton {
  border: 0;
}

.primaryButton {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  background: linear-gradient(112deg, #cfb2ff 4.94%, #4d09b2 127.67%);
  color: #171717;
  font-weight: 700;
  transition: filter 140ms ease, opacity 140ms ease;
}

.primaryButton:hover {
  filter: brightness(1.1);
}

.primaryButton:disabled {
  cursor: wait;
  opacity: 0.58;
}

.buttonBlock {
  width: 100%;
}

.message {
  min-height: 0;
  margin-top: 14px;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.45;
}

.message:not(:empty) {
  min-height: 20px;
}

.workspaceShell {
  min-height: 100svh;
}

.workspaceHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 15px clamp(18px, 5vw, 90px);
  border-bottom: 1px solid #242424;
}

.workspaceBrand {
  font-size: 16px;
}

.workspaceBrand img {
  width: 32px;
  height: 32px;
}

.quietButton {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.quietButton:hover {
  background: var(--panel);
  color: var(--text);
}

.workspaceMain {
  width: min(100% - 32px, 1480px);
  margin: 0 auto;
  padding: 34px 0 60px;
}

.searchToolbar {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--panel);
}

.searchControls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 136px auto 136px auto;
  align-items: center;
  gap: 10px;
}

.queryControlGroup {
  min-width: 0;
}

.dateControlGroup {
  min-width: 0;
}

.dateInput {
  padding: 0 8px;
}

.dateSeparator {
  align-self: center;
  color: var(--soft);
}

.searchButton {
  min-width: 84px;
  min-height: 40px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
  font-weight: 700;
}

.searchButton:hover {
  background: #303030;
}

.queryPicker {
  position: relative;
}

.pickerButton {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  text-align: left;
}

.pickerButton:hover {
  background: #202020;
}

.pickerChevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.pickerMenu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #202020;
  box-shadow: var(--shadow);
}

.pickerOption {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.pickerOption:hover,
.pickerOption.isSelected {
  background: #333333;
  color: var(--text);
}

.pickerOptionGroup {
  padding: 8px 11px 4px;
  color: var(--soft);
  font-size: 11px;
  text-transform: uppercase;
}

.resultsSection {
  padding-top: 25px;
}

.productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.productCard {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-panel);
  background: var(--panel);
  transition: transform 140ms ease, background 140ms ease;
}

.productCard:hover {
  background: #2d2d2d;
  transform: translateY(-2px);
}

.productPhoto {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #202020;
}

.productPhoto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.productCardBody {
  padding: 14px;
}

.productTitle {
  display: block;
  min-height: 39px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.productTitle:hover {
  color: var(--accent-light);
}

.productId {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.productAttrs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.productAttr {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.productAttr strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.salesSpark {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 28px;
  margin-top: 15px;
  padding-top: 5px;
}

.salesSpark span {
  min-width: 1px;
  flex: 1 1 0;
  border-radius: 2px 2px 0 0;
  background: var(--accent-light);
  opacity: 0.72;
}

.emptyState {
  padding: 70px 24px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  text-align: center;
}

.emptyState h2 {
  font-size: 20px;
}

.emptyState p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.pageLoader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(23, 23, 23, 0.82);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.loaderMark {
  width: 28px;
  height: 28px;
  margin: auto;
  border: 2px solid #555;
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 860px) {
  .searchControls {
    grid-template-columns: minmax(220px, 1fr) 1fr;
  }

  .dateSeparator {
    display: none;
  }

  .searchButton {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .authPanel,
  .searchToolbar {
    padding: 20px;
  }

  .workspaceHeader {
    padding-inline: 16px;
  }

  .workspaceBrand span {
    font-size: 14px;
  }

  .workspaceMain {
    width: min(100% - 20px, 1480px);
    padding-top: 20px;
  }

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

  .productGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .productCardBody {
    padding: 11px;
  }

  .productTitle {
    font-size: 12px;
  }
}
