body.v5-shell {
  --wx-top: 0px;
  --wx-tabbar: 0px;
  --wx-safe: 0px;
  --v5-paper: #f7f3e9;
  --v5-ink: #302729;
  --v5-wine: #703b4a;
  --v5-rose: #c97d7d;
  --v5-muted: #6d625d;
  --v5-rule: #d6c9bc;
  --v5-tint: #eee5da;
  --v5-gutter: clamp(20px, 5.1vw, 80px);
  --v5-serif: Baskerville, "Bodoni 72", "Songti SC", STSong, Georgia, serif;
  background: var(--v5-paper);
  color: var(--v5-ink);
}

body.v5-shell #wx-status,
body.v5-shell #wx-capsule,
body.v5-shell #wx-title,
body.v5-shell #tabbar {
  display: none !important;
}

body.v5-shell #topbar {
  position: relative;
  top: auto;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 32px);
  width: 100%;
  max-width: none;
  min-height: 66px;
  height: auto;
  margin: 0;
  padding: 0 max(var(--v5-gutter), calc((100% - 1440px) / 2));
  background: var(--v5-paper);
  border: 0;
  border-bottom: 1px solid var(--v5-rule);
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

body.v5-shell #v5-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--v5-ink);
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

body.v5-shell #topbar .brand-long { display: inline !important; }
body.v5-shell #topbar .brand-logo { width: auto; height: 46px; border-radius: 0; object-fit: contain; }

body.v5-shell #nav {
  display: flex !important;
  flex: 1;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 4px;
  background: none;
  border: 0;
  box-shadow: none;
}

body.v5-shell #nav a {
  display: inline-flex;
  align-items: center;
  min-height: 65px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--v5-muted);
  font-size: 14px;
  text-decoration: none;
}

body.v5-shell #nav a:hover { color: var(--v5-wine); }
body.v5-shell #nav a[aria-current] {
  color: var(--v5-wine);
  border-bottom-color: var(--v5-wine);
  font-weight: 700;
}

body.v5-shell #who { display: block !important; margin: 0; }
.v5-account { position: relative; }
.v5-account summary,
.v5-order-search {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--v5-wine);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.v5-account summary {
  padding: 0 13px;
  list-style: none;
  border: 1px solid var(--v5-rule);
  border-radius: 999px;
  background: var(--v5-tint);
}
.v5-account summary::-webkit-details-marker { display: none; }
.v5-account summary::after {
  width: 5px;
  height: 5px;
  margin: -3px 0 0 2px;
  border-right: 1px solid;
  border-bottom: 1px solid;
  transform: rotate(45deg);
  content: "";
}
.v5-account-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 166px;
  background: var(--v5-paper);
  border: 1px solid var(--v5-rule);
  border-radius: 9px;
  box-shadow: 0 5px 18px #3027291c;
}
.v5-account-menu > * {
  display: block;
  padding: 11px 14px;
  overflow-wrap: anywhere;
}
.v5-account-menu a, .v5-account-menu button {
  border: 0;
  background: none;
  color: var(--v5-wine);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.v5-account-menu a:hover, .v5-account-menu button:hover { background: var(--v5-tint); }

.v5-order-search {
  border: 0;
  padding: 0 3px;
  background: none;
  color: var(--v5-muted);
}
.v5-order-search[hidden] { display: none; }
.v5-search-icon {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.v5-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 6px;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
  content: "";
}

body.v5-shell #view {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 max(var(--v5-gutter), calc((100% - 1440px) / 2)) 24px;
}

.v5-lookup {
  position: fixed;
  max-width: min(100%, 420px);
  width: 100%;
  max-height: 100dvh;
  height: 100dvh;
  margin: 0 0 0 auto;
  padding: 24px;
  border: 0;
  border-left: 1px solid var(--v5-rule);
  background: var(--v5-paper);
  color: var(--v5-ink);
}
.v5-lookup::backdrop { background: #30272966; }
.v5-lookup > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.v5-lookup > header h2 {
  margin: 0;
  font: 700 27px var(--v5-serif);
}
.v5-lookup > header button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--v5-wine);
  font: inherit;
  cursor: pointer;
}
.v5-lookup-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 8px 0 18px;
}
.v5-lookup-controls input { min-width: 0; width: 100%; min-height: 44px; }
.v5-lookup-controls .btn, .v5-lookup-order .btn { min-height: 44px; }
.v5-lookup-order { padding: 14px; border: 1px solid var(--v5-rule); border-radius: 8px; }
.v5-lookup-order p { margin: 8px 0 16px; overflow-wrap: anywhere; }

#topbar :focus-visible, .v5-lookup :focus-visible {
  outline: 2px solid var(--v5-wine);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  body.v5-shell #topbar { flex-wrap: wrap; gap: 4px 12px; padding-inline: 16px; }
  body.v5-shell #view { padding-inline: 16px; }
  body.v5-shell #v5-brand { margin-right: auto; }
  body.v5-shell #nav { order: 4; flex: 0 0 100%; }
  body.v5-shell #nav a { min-height: 44px; padding-inline: 7px; }
}

@media (max-width: 480px) {
  body.v5-shell #topbar { gap: 1px 9px; padding-inline: 12px; }
  body.v5-shell #view { padding-inline: 12px; }
  body.v5-shell #v5-brand { font-size: 13px; gap: 5px; }
  body.v5-shell #topbar .brand-logo { height: 28px; }
  .v5-order-search, .v5-account { font-size: 12px; }
  .v5-account summary { padding-inline: 8px; gap: 4px; }
  body.v5-shell #nav a { font-size: 12px; padding-inline: 5px; }
  .v5-lookup {
    inset: auto 0 0;
    margin: 0;
    max-width: none;
    max-height: 90dvh;
    height: auto;
    min-height: 240px;
    border: 1px solid var(--v5-rule);
    border-radius: 16px 16px 0 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

body.v5-shell .cal-pop { z-index: 300; }
