.nav-actions {
  --nav-control-size: 42px;
  flex: none;
  position: relative;
}

.appearance-toggle,
.nav .account-nav,
.nav .cart-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--nav-control-size);
  min-width: 0;
  height: var(--nav-control-size);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.appearance-settings[hidden], .appearance-panel[hidden] { display: none; }
.appearance-toggle svg, .account-nav svg, .nav-cart-icon { width: 20px; height: 20px; }
.appearance-toggle .theme-sun,
html[data-theme="light"] .appearance-toggle .theme-moon { display: none; }
html[data-theme="light"] .appearance-toggle .theme-sun { display: block; }

.appearance-panel {
  position: absolute;
  z-index: 2;
  top: calc(100% + 10px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 4px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--dark);
  box-shadow: 0 8px 30px rgb(0 0 0 / 18%);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
}
html[data-theme="light"] .appearance-panel { background: var(--surface); }
.appearance-theme, .appearance-size {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 12px;
}
.appearance-theme {
  width: 100%;
  min-height: 46px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.appearance-track {
  display: flex;
  align-items: center;
  width: 36px;
  height: 22px;
  padding: 2px;
  border: 1px solid currentColor;
  border-radius: 100px;
}
.appearance-track::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: currentColor;
}
.appearance-theme[aria-checked="true"] .appearance-track {
  justify-content: flex-end;
  color: var(--ink);
  background: var(--action);
}
.appearance-size { padding-top: 12px; border-top: 1px solid var(--line); }
.appearance-size output { color: var(--muted); font-variant-numeric: tabular-nums; }
.appearance-size input {
  grid-column: 1 / -1;
  width: 100%;
  height: 38px;
  margin: 0;
  accent-color: var(--link);
  cursor: pointer;
}

.appearance-toggle:hover,
.nav .account-nav:hover,
.nav .nav-actions a[aria-current="page"] { border-color: currentColor; }
.nav .nav-actions a[aria-current="page"] { box-shadow: inset 0 0 0 1px currentColor; }

.nav .cart-count { position: relative; }
.nav .cart-count .count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: max(16px, 1rem);
  height: max(16px, 1rem);
  padding: 0 3px;
  border-radius: 100px;
  font-size: .625rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.nav-cart-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 851px) and (max-width: 900px) {
  .nav .nav-inner { gap: 10px; }
}

@media (max-width: 520px) {
  .nav .nav-inner { gap: 6px; }
  .nav .nav-actions { --nav-control-size: 38px; gap: 7px; }
  .nav .menu-btn { width: var(--nav-control-size); height: var(--nav-control-size); }
}

@media (max-width: 600px) {
  .nav .brand { min-width: 0; }
  .nav .brand > span { white-space: normal; line-height: .95; }
  .nav .brand small { line-height: 1.2; }
}

@media (min-width: 390px) and (max-width: 430px) {
  .nav .brand { font-size: 1.25rem; gap: 6px; }
  .nav .brand-mark { width: 41px; height: 30px; }
}

@media (max-width: 389px) {
  .nav .nav-actions { --nav-control-size: 36px; gap: 4px; }
}

@media (max-width: 350px) {
  .nav .nav-inner { gap: 4px; }
  .nav .brand small { display: none; }
}
