:root {
  color-scheme: dark;
  --bg: #080b0a;
  --surface: rgba(13, 18, 16, 0.96);
  --surface-soft: rgba(20, 27, 24, 0.88);
  --text: #f5f7f6;
  --muted: #9da7a2;
  --faint: #6f7874;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #52e59a;
  --accent-dark: #0f2f21;
  --danger: #ff7c76;
  --warning: #f2c66d;
  --radius: 8px;
  --header-height: 72px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 80px);
  background: rgba(8, 11, 10, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 720;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(82, 229, 154, 0.54);
  border-radius: 7px;
  background: var(--accent-dark);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.brand-mark::before { left: 6px; top: 6px; }
.brand-mark::after { right: 6px; top: 6px; }
.brand-mark span::before { left: 6px; bottom: 6px; }
.brand-mark span::after { right: 6px; bottom: 6px; }

.service-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.service-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(82, 229, 154, 0.75);
}

.portal-hero {
  position: relative;
  isolation: isolate;
  min-height: min(940px, 100vh);
  padding-top: var(--header-height);
  overflow: hidden;
  background-color: #0b0f0d;
  background-image: url("assets/order-journey.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.portal-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(3, 6, 5, 0.38);
}

.portal-layout {
  width: min(1440px, 100%);
  min-height: calc(min(940px, 100vh) - var(--header-height));
  margin: 0 auto;
  padding: 54px clamp(24px, 5vw, 80px) 48px;
  display: grid;
  grid-template-columns: minmax(440px, 540px) minmax(280px, 1fr);
  align-items: center;
  gap: clamp(54px, 9vw, 160px);
}

.portal-copy {
  width: 100%;
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 520px;
  font-size: 58px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: 0;
}

.intro {
  margin: 18px 0 30px;
  max-width: 480px;
  color: #c5ccc8;
  font-size: 16px;
  line-height: 1.7;
}

.portal-tool {
  width: 100%;
  min-height: 430px;
  padding: 8px 26px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(20px);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 58px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.mode-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.mode-button::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: -1px;
  left: 20%;
  height: 2px;
  background: transparent;
}

.mode-button:hover {
  color: var(--text);
}

.mode-button.is-active {
  color: var(--text);
}

.mode-button.is-active::after {
  background: var(--accent);
}

.mode-panel {
  min-height: 330px;
}

.field {
  margin-bottom: 15px;
}

.field label,
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  margin-bottom: 7px;
  color: #dce1de;
  font-size: 13px;
  font-weight: 650;
}

.label-row label {
  margin: 0;
}

.label-row span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
}

.input-shell {
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(82, 229, 154, 0.8);
  background: rgba(82, 229, 154, 0.035);
}

.input-shell.has-error {
  border-color: var(--danger);
}

.input-shell input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.input-shell input::placeholder {
  color: #626b67;
}

input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.42;
}

.field-error {
  min-height: 16px;
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.35;
}

.privacy-note {
  margin: -1px 0 14px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #06120c;
}

.primary-button:hover {
  background: #75ecad;
  border-color: #75ecad;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.secondary-button {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.secondary-button:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.04);
}

.success-state {
  padding: 23px 0 3px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 1px solid rgba(82, 229, 154, 0.46);
  border-radius: 50%;
  background: var(--accent-dark);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.result-eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.success-state h2,
.result-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.code-ticket {
  margin: 22px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.code-ticket span {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 11px;
}

.code-ticket strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.success-product {
  margin: -11px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#queryPanel form {
  padding-top: 7px;
}

.query-empty {
  display: grid;
  place-items: center;
  min-height: 154px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.query-empty-mark {
  width: 34px;
  height: 34px;
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px var(--surface), inset 0 0 0 10px var(--line-strong);
}

.query-empty p {
  margin: 0 0 18px;
}

.order-result {
  margin-top: 20px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(242, 198, 109, 0.3);
  border-radius: 999px;
  background: rgba(242, 198, 109, 0.08);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.status-badge.processing {
  border-color: rgba(82, 229, 154, 0.3);
  background: rgba(82, 229, 154, 0.08);
  color: var(--accent);
}

.status-badge.completed {
  border-color: rgba(82, 229, 154, 0.42);
  background: var(--accent-dark);
  color: var(--accent);
}

.status-badge.attention {
  border-color: rgba(255, 124, 118, 0.38);
  background: rgba(255, 124, 118, 0.08);
  color: var(--danger);
}

.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin: 19px 0 20px;
}

.result-details div {
  min-width: 0;
}

.result-details dt {
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 10px;
}

.result-details dd {
  margin: 0;
  overflow: hidden;
  color: #dce1de;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding-top: 17px;
  color: var(--faint);
  font-size: 10px;
}

.timeline li::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 0;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #4b534f;
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 0;
  left: 8px;
  height: 1px;
  background: var(--line-strong);
}

.timeline li:last-child::after {
  display: none;
}

.timeline li.is-complete {
  color: #dce1de;
}

.timeline li.is-complete::before {
  background: var(--accent);
}

.result-message {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.035);
  color: #dce1de;
  font-size: 11px;
  line-height: 1.55;
}

.journey-summary {
  align-self: end;
  justify-self: end;
  width: min(100%, 278px);
  margin-bottom: 22px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 11, 10, 0.74);
  backdrop-filter: blur(14px);
}

.journey-summary ol {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-summary li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
}

.journey-summary li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -15px;
  left: 15px;
  width: 1px;
  background: rgba(82, 229, 154, 0.32);
}

.journey-index {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.journey-summary div {
  display: grid;
  gap: 3px;
}

.journey-summary strong {
  font-size: 12px;
}

.journey-summary div span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.service-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0d1210;
}

.service-strip div {
  min-width: 0;
  padding: 26px clamp(24px, 5vw, 80px);
  border-right: 1px solid var(--line);
}

.service-strip div:last-child {
  border-right: 0;
}

.service-strip strong,
.service-strip span {
  display: block;
}

.service-strip strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.service-strip span {
  color: var(--muted);
  font-size: 11px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(24px, 5vw, 80px);
  color: var(--faint);
  background: var(--bg);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #161c19;
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  font-size: 12px;
}

@media (max-width: 980px) {
  .portal-hero {
    min-height: auto;
    background-position: 62% center;
  }

  .portal-shade {
    background: rgba(3, 6, 5, 0.62);
  }

  .portal-layout {
    min-height: auto;
    padding-top: 48px;
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
    gap: 28px;
  }

  .journey-summary {
    justify-self: start;
    width: 100%;
    max-width: 560px;
    margin: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 62px;
  }

  .site-header {
    padding: 0 18px;
  }

  .brand {
    font-size: 14px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .service-state {
    font-size: 11px;
  }

  .portal-hero {
    background-position: 67% top;
  }

  .portal-shade {
    background: rgba(3, 6, 5, 0.69);
  }

  .portal-layout {
    padding: 36px 16px 32px;
  }

  .kicker {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 40px;
  }

  .intro {
    margin: 12px 0 22px;
    font-size: 14px;
  }

  .portal-tool {
    min-height: 420px;
    padding: 7px 16px 18px;
  }

  .mode-switch {
    min-height: 54px;
  }

  .input-shell {
    height: 45px;
  }

  .success-actions {
    grid-template-columns: 1fr;
  }

  .result-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .journey-summary {
    display: none;
  }

  .service-strip {
    grid-template-columns: 1fr;
  }

  .service-strip div {
    padding: 20px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-strip div:last-child {
    border-bottom: 0;
  }

  .site-footer {
    flex-direction: column;
    padding: 22px 18px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
