:root {
  --app-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: var(--app-font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font-size: inherit;
  line-height: 1.45;
}

button,
.btn,
.primary-action,
.secondary-action,
.admin-primary-action,
.admin-secondary-action,
.admin-danger-action,
.admin-link-button {
  max-width: 100%;
  white-space: nowrap;
}

.portal-nav a,
.admin-nav a {
  font-size: 13px;
}

.portal-nav p,
.admin-sidebar-label {
  font-size: 10px;
}

.portal-header-actions,
.admin-header-actions,
.balance-chip,
.portal-user b,
.admin-user-chip {
  font-size: 12px;
}

.portal-user small,
.admin-eyebrow,
.page-heading>div>span,
.admin-page-heading>div>span {
  font-size: 10px;
}

.page-heading p,
.admin-page-heading p,
.purchase-builder-card>header p {
  font-size: 12px;
  line-height: 1.6;
}

.primary-action,
.secondary-action,
.admin-primary-action,
.admin-secondary-action,
.admin-danger-action,
.admin-link-button,
.link-button {
  font-size: 12px;
}

.portal-card header h2,
.admin-card header h2,
.admin-card-heading h2 {
  font-size: 15px;
}

.portal-card header p,
.admin-card header p,
.admin-card-heading p,
.admin-action-form p {
  font-size: 11px;
  line-height: 1.55;
}

.admin-table th,
.portal-table th {
  font-size: 11px;
}

.admin-table td,
.portal-table td {
  font-size: 12px;
  line-height: 1.5;
}

.admin-table td small,
.portal-table td small,
.admin-table code,
.portal-table code {
  font-size: 10px;
}

.admin-status,
.portal-status,
.admin-empty {
  font-size: 11px;
}

.admin-filter label,
.admin-action-form label,
.admin-threshold-form label,
.admin-settings-fields label,
.email-settings-form label,
.pricing-rule-form label,
.product-base-form label,
.bulk-pricing-form label,
.line-price-form label,
.smtp-test-form label,
.payment-provider-form label,
.smtp-settings-form label {
  font-size: 12px;
  line-height: 1.45;
}

.admin-filter input,
.admin-filter select,
.admin-action-form input,
.admin-action-form select,
.admin-action-form textarea,
.admin-threshold-form input,
.admin-settings-fields input:not([type="checkbox"]),
.admin-settings-fields select,
.admin-settings-fields textarea,
.email-settings-form input:not([type="checkbox"]),
.email-settings-form select,
.email-settings-form textarea,
.pricing-rule-form input,
.product-base-form input:not([type="checkbox"]),
.bulk-pricing-form input,
.bulk-pricing-form select,
.line-price-form input,
.payment-provider-form input,
.payment-provider-form select,
.payment-provider-form textarea,
.smtp-settings-form input,
.smtp-settings-form select,
.smtp-settings-form textarea,
.smtp-test-form input {
  font-family: var(--app-font);
  font-size: 13px;
}

.admin-action-form select,
.email-settings-form select,
.payment-provider-form select,
.smtp-settings-form select {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid #d9e3ef;
  border-radius: 7px;
  background: #fbfcfe;
  color: #2a3c57;
}

.admin-config-note,
.admin-runtime-grid span,
.bulk-pricing-hint,
.price-save-all-bar span,
.product-base-form label small,
.email-settings-form small {
  font-size: 11px;
  line-height: 1.55;
}

.admin-settings-tabs a {
  font-size: 12px;
}

.pricing-rule-form>button {
  min-width: 142px;
}

.purchase-config-label b,
.location-tabs button b {
  font-size: 12px;
}

.purchase-config-label small,
.location-tabs button small,
.city-choice-grid button small,
.purchase-order-note,
.purchase-order-card .purchase-total span {
  font-size: 10px;
  line-height: 1.45;
}

.city-choice-grid button b,
.city-choice-grid button strong,
.purchase-order-details dt,
.purchase-order-details dd,
.purchase-payment strong,
.purchase-payment>span,
.purchase-stock,
.field-hint {
  font-size: 11px;
}

.portal-form label,
.portal-dialog label,
.login-form label {
  font-size: 12px;
}

.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-dialog input,
.portal-dialog select,
.portal-dialog textarea,
.login-form input {
  font-family: var(--app-font);
  font-size: 13px;
}

.auth-card>p {
  font-size: 13px;
}

.auth-note,
.auth-benefits,
.form-error {
  font-size: 11px;
  line-height: 1.55;
}

.nav-mega-grid b,
.nav-mega-head strong {
  font-size: 12px;
}

.nav-mega-grid small,
.nav-mega-head>a,
.footer p,
.footer small {
  font-size: 10px;
  line-height: 1.5;
}

.admin-body.theme-dark .admin-action-form select,
.admin-body.theme-dark .email-settings-form select,
.admin-body.theme-dark .payment-provider-form select,
.admin-body.theme-dark .smtp-settings-form select,
.admin-body.theme-system-dark .admin-action-form select,
.admin-body.theme-system-dark .email-settings-form select,
.admin-body.theme-system-dark .payment-provider-form select,
.admin-body.theme-system-dark .smtp-settings-form select {
  border-color: #35465f;
  background: #111a2b;
  color: #edf3fb;
}

@media (max-width: 600px) {
  .portal-nav a,
  .admin-nav a {
    font-size: 14px;
  }

  .admin-primary-action,
  .admin-secondary-action,
  .admin-danger-action,
  .primary-action,
  .secondary-action {
    min-height: 40px;
  }
}

/* Logged-in public navigation follows the compact utility layout used by the
   reference header while keeping every account action keyboard accessible. */
.nav-actions-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-search {
  width: min(220px, 20vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid #e1e6ee;
  border-radius: 19px;
  background: #fbfcfe;
  color: #738097;
}

.site-search:focus-within {
  border-color: #b8cdf3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 104, 243, .08);
}

.site-search > span {
  flex: 0 0 auto;
  color: #5f6d82;
  font-size: 18px;
  line-height: 1;
}

.site-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #26344b;
  font: inherit;
  font-size: 12px;
}

.site-search kbd {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid #e1e6ee;
  border-radius: 5px;
  background: #f5f7fb;
  color: #8a96a8;
  font: inherit;
  font-size: 10px;
  line-height: 1;
}

.nav-preference-form,
.nav-theme-picker,
.nav-account-menu {
  position: relative;
  margin: 0;
}

.nav-icon-button {
  position: relative;
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #26344b;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.nav-icon-button:hover,
.nav-icon-button:focus-visible,
.nav-theme-picker[open] > .nav-icon-button {
  background: #f0f5ff;
  color: #1268f3;
  outline: 0;
}

.nav-icon-button > span {
  font-size: 21px;
  line-height: 1;
}

.nav-bell-icon {
  position: relative;
  width: 13px;
  height: 13px;
  display: block;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 3px 3px;
}

.nav-bell-icon::before {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-bell-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.nav-palette-icon {
  position: relative;
  width: 19px;
  height: 17px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 50% 48% 48% 44%;
  transform: rotate(-18deg);
}

.nav-palette-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 6px -1px 0 currentColor, 9px 5px 0 currentColor, 3px 8px 0 currentColor;
}

.nav-palette-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.nav-language-button > span {
  font-size: 19px;
}

.nav-language-button > b {
  position: absolute;
  right: -2px;
  bottom: 0;
  padding: 1px 3px;
  border-radius: 4px;
  background: #fff;
  color: #54647b;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.nav-icon-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #ef4f59;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.nav-theme-picker > summary,
.nav-account-menu > summary {
  list-style: none;
}

.nav-theme-picker > summary::-webkit-details-marker,
.nav-account-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-theme-menu,
.nav-account-menu > div {
  position: absolute;
  z-index: 80;
  top: 45px;
  right: 0;
  min-width: 148px;
  padding: 8px;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(27, 50, 91, .16);
}

.nav-theme-menu form,
.nav-account-menu > div {
  display: grid;
  gap: 4px;
}

.nav-theme-menu button,
.nav-account-menu > div a,
.nav-account-menu > div form button {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52627a;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.nav-theme-menu button:hover,
.nav-account-menu > div a:hover,
.nav-account-menu > div form button:hover {
  background: #f0f5ff;
  color: #1268f3;
}

.nav-account-menu > div {
  min-width: 160px;
  gap: 7px;
  padding: 11px;
}

.nav-account-menu > div strong {
  padding: 2px 9px 7px;
  border-bottom: 1px solid #edf0f5;
  color: #26344b;
  font-size: 11px;
}

.nav-account-menu > div form {
  margin: 0;
}

.nav-account-menu > div form button {
  color: #b4434d;
}

.nav-avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #a9cf3f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.nav-avatar:hover,
.nav-account-menu[open] > .nav-avatar {
  box-shadow: 0 0 0 3px rgba(169, 207, 63, .2);
}

@media (max-width: 1120px) {
  .nav-actions-auth {
    gap: 5px;
  }

  .site-search {
    width: 165px;
  }

  .site-search kbd {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-search {
    width: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .site-search input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .nav-actions-auth .nav-icon-button,
  .nav-avatar {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 560px) {
  .nav-actions-auth {
    gap: 2px;
  }

  .nav-notification-button,
  .nav-language-button {
    display: none;
  }

  .nav-theme-menu {
    right: -30px;
  }
}

.home-body .nav-icon-button {
  color: #26344b;
}

.home-body .nav-account-menu > div,
.home-body .nav-theme-menu {
  background: #fff;
}

.portal-body.theme-dark .site-search,
.portal-body.theme-system-dark .site-search {
  background: #111a2b;
  border-color: #35465f;
}

/* Keep the notification bell centered inside the bordered console button. */
.portal-notification-button {
  width: 46px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  background: #fff;
  color: #52627a;
  line-height: 1;
}

.portal-notification-button:hover,
.portal-notification-button:focus-visible {
  border-color: var(--theme-accent-border);
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

.portal-notification-button .nav-bell-icon {
  flex: 0 0 13px;
  margin: 0;
}

.portal-notification-button .inbox-badge {
  top: -7px;
  right: -8px;
  min-width: 19px;
  height: 19px;
  border: 2px solid #fff;
  border-radius: 11px;
  font-size: 9px;
}

.portal-body.theme-dark .portal-notification-button,
.portal-body.theme-system-dark .portal-notification-button {
  border-color: #35465f;
  background: #172236;
  color: #d6e0ee;
}

.portal-top-links {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-left: 2px;
  white-space: nowrap;
}

.portal-top-links a {
  color: #53627a;
  font-size: 12px;
  font-weight: 650;
}

.portal-top-links a:hover,
.portal-top-links a.active {
  color: var(--theme-accent);
}

.portal-account-menu {
  position: relative;
  margin: 0;
}

.portal-account-menu > summary {
  list-style: none;
}

.portal-account-menu > summary::-webkit-details-marker {
  display: none;
}

.portal-avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #a9cf3f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.portal-avatar:hover,
.portal-account-menu[open] > .portal-avatar {
  box-shadow: 0 0 0 3px rgba(169, 207, 63, .2);
}

.portal-account-menu > div {
  position: absolute;
  z-index: 80;
  top: 45px;
  right: 0;
  min-width: 164px;
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(27, 50, 91, .16);
}

.portal-account-menu > div strong,
.portal-account-menu > div small {
  padding: 0 8px;
}

.portal-account-menu > div strong {
  color: #26344b;
  font-size: 11px;
}

.portal-account-menu > div small {
  padding-bottom: 7px;
  border-bottom: 1px solid #edf0f5;
  color: #8995a7;
  font-size: 9px;
}

.portal-account-menu > div a,
.portal-account-menu > div .link-button {
  min-height: 32px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 8px;
  border-radius: 6px;
  color: #52627a;
  font-size: 11px;
  text-decoration: none;
}

.portal-account-menu > div a:hover,
.portal-account-menu > div .link-button:hover {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

.portal-account-menu > div form {
  margin: 0;
}

.portal-account-menu > div .link-button {
  color: #b4434d;
  cursor: pointer;
}

.portal-body.theme-dark .portal-top-links a,
.portal-body.theme-system-dark .portal-top-links a,
.portal-body.theme-dark .portal-account-menu > div,
.portal-body.theme-system-dark .portal-account-menu > div {
  color: #d6e0ee;
  background: #172236;
  border-color: #35465f;
}

.portal-body.theme-dark .portal-account-menu > div strong,
.portal-body.theme-system-dark .portal-account-menu > div strong {
  color: #edf3fb;
}

@media (max-width: 1180px) {
  .portal-top-links {
    gap: 11px;
  }

  .portal-top-links a:nth-child(3) {
    display: none;
  }
}

@media (max-width: 980px) {
  .portal-top-links {
    display: none;
  }

  .portal-header .portal-search {
    width: 220px;
  }
}

@media (max-width: 620px) {
  .portal-header .portal-search {
    width: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .portal-header .portal-search input,
  .portal-header .balance-chip,
  .portal-header .preference-controls {
    display: none;
  }

  .portal-notification-button {
    display: none;
  }
}
