:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #edf5ff;
  --ink: #142031;
  --muted: #657184;
  --line: #dbe3ef;
  --primary: #116dff;
  --primary-dark: #0750c6;
  --aqua: #0fb7b2;
  --green: #22a06b;
  --amber: #f59e0b;
  --danger: #d83a52;
  --shadow: 0 14px 38px rgba(32, 54, 88, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 109, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 183, 178, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, #eef6ff 0%, var(--bg) 36%, #f7f7fb 100%);
  background-size: 26px 26px, 26px 26px, auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body:not(.logged-in) .app-only {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(219, 227, 239, 0.8);
  backdrop-filter: blur(16px);
}

.topbar::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--aqua), transparent);
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.tagline {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px 14px 88px;
}

body:not(.logged-in) .shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding-bottom: 18px;
}

body.legal-open .shell {
  align-items: start;
  padding-top: 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  overflow: hidden;
  padding: 22px;
  min-height: 360px;
  border: 1px solid rgba(219, 227, 239, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 246, 255, 0.94) 58%, rgba(234, 250, 248, 0.96) 100%),
    repeating-linear-gradient(120deg, transparent 0 18px, rgba(17, 109, 255, 0.08) 18px 19px);
  box-shadow: var(--shadow);
}

.login-page {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: start;
  min-height: calc(100vh - 36px);
  padding-top: 10px;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 10% -12% auto auto;
  width: min(460px, 72vw);
  height: min(460px, 72vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 109, 255, 0.18), transparent 65%);
  pointer-events: none;
}

.login-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 2px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 22px;
  font-weight: 900;
}

.login-logo span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
  font-size: 22px;
}

.login-nav-links {
  display: inline-flex;
  gap: 12px;
}

.login-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.login-brand {
  position: relative;
  z-index: 2;
  padding: 24px 6px 0;
}

.login-brand h1 {
  margin: 0;
  font-size: clamp(38px, 12vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-brand p {
  margin: 14px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 700;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.login-feature-grid div {
  padding: 12px;
  border: 1px solid rgba(219, 227, 239, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(32, 54, 88, 0.08);
}

.login-feature-grid span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.login-feature-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.login-feature-grid p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.login-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.login-trust span {
  padding: 7px 9px;
  border: 1px solid rgba(15, 183, 178, 0.2);
  border-radius: 999px;
  color: #075f5c;
  background: rgba(221, 250, 247, 0.76);
  font-size: 12px;
  font-weight: 900;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(17, 109, 255, 0.18);
  border-radius: 999px;
  color: #075f5c;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
}

.ai-badge span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
}

.hero-copy h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(28px, 8vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-sub {
  margin: 12px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
}

.ai-console {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px;
  max-width: 360px;
  border: 1px solid rgba(17, 109, 255, 0.2);
  border-radius: 8px;
  color: #d8fff9;
  background: #132238;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.ai-console span:first-child {
  color: #6ee7df;
}

.hero-visual {
  position: relative;
  min-height: 220px;
}

.hero-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.hero-visual img {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 190px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 44px rgba(17, 109, 255, 0.18);
}

.signal-grid {
  position: absolute;
  inset: -20px;
  background:
    linear-gradient(90deg, rgba(17, 109, 255, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 183, 178, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: center bottom;
}

.floating-token {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  color: #fff;
  background: rgba(19, 34, 56, 0.9);
  box-shadow: 0 12px 28px rgba(19, 34, 56, 0.22);
  font-size: 13px;
  font-weight: 900;
}

.token-a {
  top: 10px;
  right: 18px;
}

.token-b {
  right: 76px;
  bottom: 34px;
  background: rgba(17, 109, 255, 0.92);
}

.token-c {
  bottom: 88px;
  left: 12px;
  background: rgba(15, 183, 178, 0.92);
}

.hero-actions,
.form-actions,
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.auth-card {
  position: relative;
  z-index: 2;
  overflow: hidden;
  margin-top: -8px;
  padding: 24px 18px 22px;
  border: 1px solid rgba(17, 109, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(32, 54, 88, 0.12);
  backdrop-filter: blur(12px);
}

.auth-glow {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 183, 178, 0.22), transparent 66%);
  pointer-events: none;
}

#authView .auth-card {
  align-self: start;
}

.auth-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-head span,
.auth-user span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-head > div > span {
  color: var(--aqua);
  font-size: 14px;
}

.auth-head h2 {
  margin: 10px 0 0;
  color: #1b2b47;
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: 0;
}

.auth-head > strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #075f5c;
  background: #ddfaf7;
  font-size: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.auth-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
}

.auth-switch {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.auth-switch button {
  min-height: 0;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 900;
}

.auth-switch button:hover {
  color: var(--primary-dark);
}

.auth-form {
  display: none;
  gap: 20px;
}

.auth-form.active {
  display: grid;
}

.auth-form.is-disabled {
  opacity: 0.62;
}

.auth-form label {
  display: grid;
  gap: 9px;
  color: #405779;
  font-size: 13px;
  font-weight: 800;
}

.auth-form label:not(.agree-line) {
  margin-top: 2px;
}

.auth-form .agree-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 2px;
}

.auth-form .agree-line input {
  appearance: none;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
  border: 2px solid #8a96a8;
  border-radius: 4px;
  padding: 0;
  background: #fff;
  accent-color: var(--primary);
}

.auth-form .agree-line input:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.auth-form .agree-line input:checked::before {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px 0 0 5px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-form .agree-line input:focus {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(17, 109, 255, 0.12);
}

.agree-line span {
  display: block;
}

.agree-line a,
.agree-line button {
  color: var(--primary);
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: none;
  font-weight: 900;
  line-height: inherit;
}

.agree-line button:hover {
  color: var(--primary-dark);
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: 0;
}

.auth-form input:disabled {
  opacity: 1;
  color: #7f8795;
  background: #e8edf4;
  border-color: #cdd6e3;
  cursor: not-allowed;
}

.auth-form button:disabled {
  opacity: 0.64;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-form.consent-locked .slider-track {
  opacity: 0.68;
  filter: grayscale(0.45);
}

.legal-page {
  display: grid;
  gap: 12px;
  width: min(860px, 100%);
  margin: 0 auto;
}

.legal-back {
  justify-self: start;
}

.legal-document {
  padding: 18px;
  border: 1px solid rgba(17, 109, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.legal-kicker {
  color: var(--aqua);
  font-size: 13px;
  font-weight: 900;
}

.legal-document h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.1;
  letter-spacing: 0;
}

.legal-intro,
.legal-date,
.legal-document p {
  color: var(--muted);
  line-height: 1.75;
}

.legal-date {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.legal-sections {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.legal-sections section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.legal-sections h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.legal-sections p {
  margin: 8px 0 0;
}

.auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 109, 255, 0.12);
}

.auth-form input::placeholder {
  color: #7f8795;
  font-size: 13px;
  font-weight: 700;
}

.slider-verify {
  user-select: none;
  touch-action: none;
}

.slider-track {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(17, 109, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 109, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 183, 178, 0.08) 1px, transparent 1px),
    #f7fbff;
  background-size: 18px 18px;
}

.slider-target {
  position: absolute;
  top: 7px;
  width: 34px;
  height: 30px;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  background: rgba(17, 109, 255, 0.08);
}

.slider-knob {
  position: absolute;
  left: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
  box-shadow: 0 8px 18px rgba(17, 109, 255, 0.2);
  font-size: 12px;
  font-weight: 900;
  touch-action: none;
}

.slider-track span {
  padding-left: 56px;
  padding-right: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.slider-verify.verified .slider-track {
  border-color: rgba(34, 160, 107, 0.45);
  background: #eefbf5;
}

.slider-verify.verified .slider-target {
  border-color: var(--green);
  background: rgba(34, 160, 107, 0.12);
}

.slider-verify.verified .slider-knob {
  background: linear-gradient(135deg, var(--green), var(--aqua));
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.code-row .secondary-button {
  min-height: 42px;
  padding: 0 10px;
  white-space: nowrap;
}

.auth-tip {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-user {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed rgba(17, 109, 255, 0.24);
  border-radius: 8px;
  background: #f7fbff;
}

.auth-user.active {
  display: flex;
}

.auth-user strong {
  display: block;
  margin-top: 3px;
  word-break: break-all;
}

.primary-button,
.secondary-button,
.admin-link,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--aqua));
  box-shadow: 0 10px 20px rgba(17, 109, 255, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0b9d99);
}

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

.admin-link {
  color: var(--primary);
  background: #eaf2ff;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 28px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost.hidden {
  visibility: hidden;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.status-strip div {
  padding: 14px 10px;
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(32, 54, 88, 0.08);
}

.status-strip strong {
  display: block;
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}

.status-strip span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.product-card,
.detail,
.form-panel,
.qa-item,
.order-item,
.admin-item,
.profile,
.user-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(32, 54, 88, 0.08);
}

.product-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.product-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--aqua), var(--amber));
}

.card-signal {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: #fff;
  background: rgba(19, 34, 56, 0.82);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 900;
}

.card-signal i {
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, #6ee7df, #ffffff);
}

.product-card img,
.detail-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #dce8f7;
}

.product-body {
  padding: 14px;
}

.product-topline,
.meta-row,
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #075f5c;
  background: #ddfaf7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status {
  padding: 4px 8px;
  border-radius: 999px;
  color: #0f6a48;
  background: #e4f8ee;
  font-size: 12px;
  font-weight: 800;
}

.status.off {
  color: #8a4b00;
  background: #fff1d7;
}

.product-card h3,
.detail h2,
.form-panel h3,
.qa-item h3,
.order-item h3,
.admin-item h3,
.user-card h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.product-card p,
.detail p,
.qa-item p,
.order-item p,
.admin-item p,
.user-card p,
.profile p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-item label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.admin-item textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}

.price {
  color: var(--danger);
  font-size: 22px;
  font-weight: 900;
}

.original-price {
  color: #8a96a8;
  text-decoration: line-through;
}

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

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

.flow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.flow-step {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(32, 54, 88, 0.08);
}

.flow-step::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--aqua));
}

.flow-step span {
  color: var(--aqua);
  font-size: 12px;
  font-weight: 900;
}

.flow-step strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.flow-step p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail {
  overflow: hidden;
}

.detail-body {
  padding: 16px;
}

.detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pay-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed #b9c9dd;
  border-radius: 8px;
  background: #f7fbff;
}

.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.pay-methods button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.pay-methods button:disabled {
  color: #657184;
  background: #f3f6fa;
  cursor: not-allowed;
}

.search-row {
  margin: 0 0 12px;
}

.search-row input,
.form-panel input,
.form-panel textarea,
.form-panel select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.search-row input:focus,
.form-panel input:focus,
.form-panel textarea:focus,
.form-panel select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 109, 255, 0.12);
}

.qa-list,
.order-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.qa-item,
.order-item,
.admin-item {
  padding: 14px;
}

.answer {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  color: #075f5c;
  background: #e4fbf8;
}

.compact .qa-item {
  box-shadow: none;
}

.form-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.form-panel label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.full {
  width: 100%;
}

.profile,
.user-card,
.settings-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.settings-panel {
  display: grid;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 54, 88, 0.08);
}

.settings-panel label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.settings-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

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

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--green));
  font-weight: 900;
}

.profile h2 {
  margin: 0;
  font-size: 22px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-actions button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.quick-actions button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

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

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.small-button.danger {
  color: var(--danger);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px max(12px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.bottom-nav button.active {
  color: var(--primary);
  background: #eaf2ff;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  width: min(260px, calc(100vw - 24px));
  min-height: 48px;
  overflow: hidden;
  padding: 10px 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 4px solid #f2b500;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(32, 54, 88, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #f2b500;
  border-radius: 6px;
  color: #d69b00;
  font-size: 13px;
  font-weight: 900;
}

.toast p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.toast-close {
  width: 22px;
  height: 22px;
  border: 0;
  color: #9aa5b5;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #f2b500;
  transform-origin: left center;
}

.toast.running .toast-progress {
  animation: toast-countdown 5s linear forwards;
}

@keyframes toast-countdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 18px;
}

@media (min-width: 720px) {
  .shell {
    padding: 22px 24px 102px;
  }

  body:not(.logged-in) .shell {
    padding: 28px 24px;
  }

  .login-page {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 28px;
    align-items: start;
    padding-top: 0;
  }

  .login-nav {
    grid-column: 1 / -1;
  }

  .login-brand {
    padding-top: 0;
  }

  .login-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr 0.92fr;
    align-items: center;
    min-height: 420px;
    padding: 34px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .field-grid,
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel.active {
    display: grid;
    grid-template-columns: 0.88fr 1.12fr;
    gap: 14px;
    align-items: start;
  }

  #adminOrders.active,
  #adminUsers.active {
    display: block;
  }

  .bottom-nav {
    left: 50%;
    width: min(520px, calc(100% - 28px));
    transform: translateX(-50%);
    bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
}
